xslt-1.0

How do I remove spaces in all attribute values using xslt?

女生的网名这么多〃 提交于 2019-12-19 04:09:52
问题 I want to remove spaces from all attributes in my xmls using xslt. I used strip-space , but that removes the spaces from nodes. My input xml is: <OrderList> <Order OrderDate="26-July" OrderNo="ORDER 12345" CustomertName="JOHN DOE" OrderKey="ORDKEY12345"> <ShipAddress AddressLine="ABC Colony" FirstName="John" LastName="Doe "/> </Order> </OrderList> and the xsl I used to get rid of the spaces in the attributes like CustomertName="JOHN DOE" is: <?xml version="1.0" encoding="UTF-8"?> <xsl

Get current nodes xpath

試著忘記壹切 提交于 2019-12-19 03:59:41
问题 I need to get the xpath of current node for which i have written an xsl function <func:function name="fn:getXpath"> <xsl:variable name="xpath"> <xsl:for-each select="ancestor-or-self::*"> <xsl:value-of select="concat($xpath, name())" /> <xsl:if test="not(position()=last())"> <xsl:value-of select="concat('/', $xpath)" /> </xsl:if> </xsl:for-each> </xsl:variable> <func:result select="$xpath" /> </func:function> But when I run this, I'm getting the following error file:///D:/test.xsl; Line #165;

To compare two elements(string type) in XSLT?

左心房为你撑大大i 提交于 2019-12-18 19:05:45
问题 i am new to XSLT ,can any one please suggest to me how to compare two elements coming from xml as string their values are: <OU_NAME>Vision Operations</OU_NAME> --XML code <OU_ADDR1>90 Fifth Avenue</OU_ADDR1> --XML code <xsl:choose> <xsl:when test="OU_NAME='OU_ADDR1'"> --comparing two elements coming from XML <!--remove if adrees already contain operating unit name <xsl:value-of select="OU_NAME"/> <fo:block/>--> <xsl:if test="OU_ADDR1 !='' "> <xsl:value-of select="OU_ADDR1"/> <fo:block/> </xsl

To compare two elements(string type) in XSLT?

时光怂恿深爱的人放手 提交于 2019-12-18 19:05:17
问题 i am new to XSLT ,can any one please suggest to me how to compare two elements coming from xml as string their values are: <OU_NAME>Vision Operations</OU_NAME> --XML code <OU_ADDR1>90 Fifth Avenue</OU_ADDR1> --XML code <xsl:choose> <xsl:when test="OU_NAME='OU_ADDR1'"> --comparing two elements coming from XML <!--remove if adrees already contain operating unit name <xsl:value-of select="OU_NAME"/> <fo:block/>--> <xsl:if test="OU_ADDR1 !='' "> <xsl:value-of select="OU_ADDR1"/> <fo:block/> </xsl

Merging set of elements based on a common attribute in XSLT 1.0

荒凉一梦 提交于 2019-12-18 09:45:44
问题 I m working with XSLT1.0 . My requirement is to merge set of elements based on a common attribute. I ve an xml which looks like this: <?xml version="1.0" encoding="utf-8"?> <Catalog> <product> <productId>S100</productId> <name>RNKC</name> <category>books</category> </product> <product> <productId>S100</productId> <name>RNKC</name> <category>CD</category> </product> <product> <productId>S200</productId> <name>ISDR</name> <category>eBook</category> </product> <product> <productId>S200<

Convert 31-DEC-2016 to 2016-12-31

随声附和 提交于 2019-12-18 09:44:40
问题 I want to convert the 31-DEC-2016 i.e., dd-mmm-yyyy to yyyy-mm-dd in the XSLT using format-dateTime function but the output is not as expected.Can anyone help on this? <ns1:QuoteDate> <xsl:value-of select='concat(xp20:format-dateTime(/Quote/QuoteHeader/QuoteDate,"[Y0001]-[M01]-[D01]"),"T00:00:00")'/> </ns1:QuoteDate> I want to get the value for this particular thing.31-DEC-2016 : This is the input and i have to transform over here in the code Once that is converted, How to concat the the

match and merge in XSLT with optional nodes

本秂侑毒 提交于 2019-12-18 09:44:33
问题 I have a sample XML message which contains multiple parent node. The requirement is if the two parent node are same, merge the child node. This works fine when all the nodes are present but doesn't work when the optional node is absent Sample Message:1 With Optional Nodes present <document> <body> <party> <gtin>1000909090</gtin> <pos> <attrGroupMany name="temperatureInformation"> <row> <gtin>1000909090</gtin> <attr name="temperatureCode">STORAGE</attr> <attrQualMany name="temperature"> <value

Change HTML dynamically thru xsl

血红的双手。 提交于 2019-12-18 09:39:37
问题 I have the following html: <!DOCTYPE html> <html> <head> <style> table, th, td { border: 1px solid black; border-collapse: collapse; } th, td { padding: 5px; } </style> </head> <body> <table style="width:100%"> <tr> <th>Name</th> <th>City</th> <th>State</th> <th>Zip</th> </tr> <tr> <td> [lastName],[firstName] </td> <td>[City]</td> <td>[State]</td> <td>[Zip]</td> </tr> </table> </body> </html> I will get the values from an xml <person> <lastName>Zones</lastName> <firstName>Adam</firstName>

Change HTML dynamically thru xsl

爱⌒轻易说出口 提交于 2019-12-18 09:39:17
问题 I have the following html: <!DOCTYPE html> <html> <head> <style> table, th, td { border: 1px solid black; border-collapse: collapse; } th, td { padding: 5px; } </style> </head> <body> <table style="width:100%"> <tr> <th>Name</th> <th>City</th> <th>State</th> <th>Zip</th> </tr> <tr> <td> [lastName],[firstName] </td> <td>[City]</td> <td>[State]</td> <td>[Zip]</td> </tr> </table> </body> </html> I will get the values from an xml <person> <lastName>Zones</lastName> <firstName>Adam</firstName>

how to make xsl tokenize work

自作多情 提交于 2019-12-18 02:42:30
问题 I have a huge xsl file but the section where i use "tokenize" to parse through a comma separated string is throwing an error. For simplicity purposes I have broke it down to just test the tokenize piece only and cannot seem to make any progress. I keep getting the following error: Expression expected. tokenize(-->[<--text],',') I tried using some example xsl shared in other posts but never managed to get it to work. I am having a difficult time understanding why my xsl code below is not valid