HI Gus
I have looked through a few other Posts/Topics but still very unfamiliar with XSLT Transform
Example of Simple XML
<?xml version="1.0" encoding="UTF-8"?>
<CODES>
<CARDCODE>552400-0-1</CARDCODE>
<CARDCODE>553204-0-1</CARDCODE>
<CARDCODE>561370-0-1</CARDCODE>
<CARDCODE>561371-0-1</CARDCODE>
<CARDCODE>561373-0-1</CARDCODE>
<CARDCODE>562568-0-1</CARDCODE>
<CARDCODE>562580-0-1</CARDCODE>
</CODES>
I really need to split this into individual XMLs files with each CARDCODE listed in each File, filenames can be the CARDCODE or Just a number
I know you'll help me out
Thanks in advance
Mark
SPLIT XML
Re: SPLIT XML
I've done similar XSLT Transforms using the Saxonica Saxon app and XSLT 2.0.
Based on your example XML your XSL stylesheet would look like this:
A sample flow with the app configured would look like this: https://drive.google.com/file/d/1GktGk0 ... sp=sharing
Based on your example XML your XSL stylesheet would look like this:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<xsl:for-each select="/CODES/CARDCODE">
<xsl:result-document method="xml" href="{.}.xml">
<CODES>
<xsl:copy-of select="." />
</CODES>
</xsl:result-document>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>