How to convert XML element names using the element's attribute value with XSLT?

I am working on an XML dataset, however I am not quite sure how to convert it to my desired format using XSLT so I can work with it. Currently I have an XML with element’s that aren’t useful to me and name attributes which hold the names of what the elements should actually be… Read More How to convert XML element names using the element's attribute value with XSLT?

how to add a suffix (1,2,3…) to the value of an attribute plus a verification text each time an element has the same text with XSLT 1.0

_2,_3…, and also a text with "CHECK IT" and so on every time the element "batch" has the same text (except for the first one), I have already an XSLT who can (almost) do that but the problem is that the suffix it add is the position of the element, and it also adds the… Read More how to add a suffix (1,2,3…) to the value of an attribute plus a verification text each time an element has the same text with XSLT 1.0

Using XSLT in a concise way to modify XML elements

I have the xml file that I totally didn’t get from somewhere else <bookstore> <book genre="autobiography" publicationdate="1981" ISBN="1-861003-11-0"> <title>The Autobiography of Benjamin Franklin</title> <author> <first-name>Benjamin</first-name> <last-name>Franklin</last-name> </author> <price>8.99</price> </book> <book genre="novel" publicationdate="1967" ISBN="0-201-63361-2"> <title>The Confidence Man</title> <author> <first-name>Herman</first-name> <last-name>Melville</last-name> </author> <price>11.99</price> </book> <book genre="philosophy" publicationdate="1991" ISBN="1-861001-57-6"> <title>The Gorgias</title> <author> <name>Plato</name> </author> <price>9.99</price> </book> </bookstore> As… Read More Using XSLT in a concise way to modify XML elements

XSLT When condition for multiple OR condition

Currently, I have a working version of below code which check if first or second entry from input payload meets the condition. How can I make changes if I need to check for multiple entries instead of adding many OR conditions (i.e: [3], [4], [5]….etc) ? <xsl:choose> <xsl:when test="(wd:Entry[1]/wd:Item = ‘ABC’ or wd:Entry[2]/wd:Item/@wd:Descriptor = ‘ABC’)">… Read More XSLT When condition for multiple OR condition

Converting XML to CSV formate using XSLT

In my case, I’m trying to convert the XML to CSV format using XSLT. But I’m getting the header, which is also iterating and printing again, and I also couldn’t add a new line to the values column. XML input: <EmployeeDetails> <Employee> <FirstName>harry</FirstName> <SecondName>potter</SecondName> <Email>harrypotter@gmail.com</Email> </Employee> <Employee> <FirstName>tony</FirstName> <SecondName>stark</SecondName> <Email>tonystark@gmail.com</Email> </Employee> </EmployeeDetails> My XLST code… Read More Converting XML to CSV formate using XSLT

XSLT – Different context of the FOR extract the value

I need some hits about different context with check of text to extract the correct value. I already did for inside for but no works proper. The XML below: <?xml version="1.0" encoding="UTF-8"?> <ORDERS05> <IDOC BEGIN="1"> <E1EDP01 SEGMENT="1"> <E1EDP05 SEGMENT="1"> <KOTXT>Total item price</KOTXT> <KRATE>20.55</KRATE> </E1EDP05> </E1EDP01> <E1EDP01 SEGMENT="1"> <E1EDP05 SEGMENT="1"> <KOTXT>Total item price</KOTXT> <KRATE>8.03</KRATE> </E1EDP05> </E1EDP01>… Read More XSLT – Different context of the FOR extract the value

XSLT transformation of multiple "flat" XML files into tree-like XML. Continuation – 2 xml files of objects and 1 with hierarchy

This is a continuation of the previous question. XSLT transformation of multiple "flat" XML files into tree-like XML I tried to build xml from more object files and got a problem. what we have: file 1.xml is $doc1 -main objects <?xml version="1.0" encoding="utf-8"?> <ADDRESSOBJECTS> <OBJECT OBJECTID="105037985" NAME="OLDER OTHER PARENT" LEVEL="2" ISACTIVE="0" /> <OBJECT OBJECTID="105037985" NAME="OTHER… Read More XSLT transformation of multiple "flat" XML files into tree-like XML. Continuation – 2 xml files of objects and 1 with hierarchy

how to add attribute to a parent when the text in the child match with XSLT 1.0

Im trying to add an attribute into a parent, when the text in a child node match, I have this input : <CS> <CN name="PICTURE 1"> <TN name="L_1"> <color>red</color> <ptCN>IN4</ptCN> <ID>10</ID> </TN> </CN> <CN name="PICTURE 2"> <TN name="L_2"> <color>blue</color> <ptCN>IN3</ptCN> <ID>20</ID> </TN> </CN> <CS> And when the attribute color = red, I need to add… Read More how to add attribute to a parent when the text in the child match with XSLT 1.0