XSLT copy groups per chunks and keep children nodes

im trying to achieve this: I have this input file <Message> <Cons> <TratEqnt> <sqNumberFinal>1</sqNumberFinal> <numberOfSls>104</numberOfSls> <Sl> <sqNumber>1</sqNumber> <id>D36831581</id> </Sl> <Sl> <sqNumber>2</sqNumber> <id>D36831582</id> </Sl> <Sl> <sqNumber>3</sqNumber> <id>D36831583</id> </Sl> <Sl> <sqNumber>4</sqNumber> <id>D36831584</id> </Sl> <Sl> <sqNumber>5</sqNumber> <id>D36831585</id> </Sl> <Sl> <sqNumber>6</sqNumber> <id>D36831586</id> </Sl> <Sl> <sqNumber>7</sqNumber> <id>D36831587</id> </Sl> </TratEqnt> <TratEqnt> <Sl> <sqNumber>1</sqNumber> <id>D36831581</id> </Sl> <Sl> <sqNumber>2</sqNumber> <id>D36831582</id> </Sl> <Sl> <sqNumber>3</sqNumber>… Read More XSLT copy groups per chunks and keep children nodes

Merge two xml with substring as key

I have two XML file. First XML <annunci> <annuncio> <any_info>222</any_info> <reference>333</reference> . . <lot_of_info> </lot_of_info> . . <some_info>1</some_info> <images> </images> </annuncio> Second XML <images> <img> <url>http://example.com/xml/img/333/somefile</url&gt; <type>0</type> <public>1</public> <share>1</share> </img> <img> <url>http://example.com/xml-feed/img/333/somefile</url&gt; <type>0</type> <public>1</public> <share>1</share> </img> </images> Merging two XML using first file <reference> (example: 333) and <url> on second file with substring (folder) with… Read More Merge two xml with substring as key

XSL: sorting the document in first transform and then transform based on key

Cannot achieve the desired result when converting the original document: <fact> <id>84f4ab12-64e5-4905-9a4f-8935addf7b31</id> <decisionDate>2021-12-01</decisionDate> <receiver> <surname>Kim</surname> <firstname>Alla</firstname> <addressInfo> <type> <code>03</code> <title>Actual residence</title> </type> <country> <code>033</code> <title>Actual residence country</title> </country> <postIndex>333333</postIndex> <region>Region3</region> </addressInfo> <addressInfo> <type> <code>01</code> <title>Permanent residence</title> </type> <country> <code>011</code> <title>Permanent residence country</title> </country> <postIndex>111111</postIndex> <region>Region1</region> </addressInfo> <addressInfo> <type> <code>02</code> <title>Temporary residence</title> </type> <country> <code>022</code> <title>Temporary… Read More XSL: sorting the document in first transform and then transform based on key

How to remove string wrapped in double square brackets [[abc]]

XML: <root> <a>This is first para [[the first para1]]</a> <a>This is second para [[the second para2]]</a> </root> XSLT 2.0 I tried: <xsl:template match=’@* | node()’> <xsl:copy> <xsl:apply-templates select=’@* | node()’/> </xsl:copy> </xsl:template> <xsl:template match="*[contains(text(),'[[‘)]"></xsl:template> Expected result: <root> <a> This is first para</a> <a> This is second para</a> </root> Thank you in advance for help. >Solution… Read More How to remove string wrapped in double square brackets [[abc]]

XSL Replace with multiple values without duplications

I’m trying to filter and then replace umlauts in a file name. Unfortunately this doesn’t really work, because if all three umlauts are included, the variable name is also written several times in the filename. <xsl:choose> <xsl:when test="contains($name,’ä’) or contains($name,’ö’) or contains($name,’ü’)"> <xsl:value-of select="replace($name, ‘ä’, ‘ae’),replace($name,’ö’,’oe’),replace($name, ‘ü’, ‘ue’) " /> </xsl:when> No matter what I… Read More XSL Replace with multiple values without duplications

How to assign the first occurrence set one of the variable value to for-each all lines

i am trying to assign the satisfied lines of first set value to target always with in for-each. Is there any filter we can add it to target element to hold the value???? My Input XML like below <process> <TransactionType> <data_xml> <transaction> <sub_documents> <transactionLine> <bPALine_l>false</bPALine_l> <part>9W0019468</part> </transactionLine> <transactionLine> <bPALine_l>true</bPALine_l> <part>9W0019233</part> </transactionLine> <transactionLine> <bPALine_l>true</bPALine_l> <part>9W0019567</part> </transactionLine>… Read More How to assign the first occurrence set one of the variable value to for-each all lines

Is it possible to match attribute from another element and retrieve its content?

When I’m in : <xsl:template match="listOfPerson/person"> for person of id "A", is it possible to retrieve his information that is stored in another element here it’s inside the element data xml : <root> <data> <person id="A"> <name> Anna </name> <age> 1 </age> </person> <person id="B"> <name> Banana </name> <age> 1 </age> </person> </data> <listOfPerson> <person>… Read More Is it possible to match attribute from another element and retrieve its content?

xsl:apply-templates returns nothing − what am I missing?

I have a simple XML response, like <?xml version="1.0" encoding="UTF-8" standalone="no"?> <searchRetrieveResponse xmlns="http://www.loc.gov/zing/srw/"&gt; <numberOfRecords>1</numberOfRecords> <records> <record> <recordData> <kitodo xmlns="http://meta.kitodo.org/v1/"&gt; <metadata name="key1">value1</metadata> <metadata name="key2">value2</metadata> <metadata name="key3">value3</metadata> </kitodo> </recordData> </record> </records> </searchRetrieveResponse> which I want to transform to this by XSLT <?xml version="1.0" encoding="utf-8"?> <mets:mdWrap xmlns:kitodo="http://meta.kitodo.org/v1/&quot; xmlns:mets="http://www.loc.gov/METS/&quot; xmlns:srw="http://www.loc.gov/zing/srw/&quot; MDTYPE="OTHER" OTHERMDTYPE="Kitodo"> <mets:xmlData> <kitodo:kitodo> <kitodo:metadata name="key1">value1</kitodo:metadata> <kitodo:metadata name="key2">value2</kitodo:metadata> <kitodo:metadata… Read More xsl:apply-templates returns nothing − what am I missing?