leif.jacobsen@dagrofa.dk

XSL-script Cross Reference table to CSV

Discussion created by leif.jacobsen@dagrofa.dk on Apr 14, 2017
Latest reply on Oct 27, 2017 by leif.jacobsen@dagrofa.dk

For use in a program like XMLspy or similar, it is possible to export your cross reference table as a xml-file.

If it is a Extensible object, you can access it through the Audit log. copy and paste the content. Otherwise you can find the XML-file directly on the local Boomi server; search for the component-ID (found at the end of the URL).

Download the xml-file to your local machine and execute the XSL-transformation below.

The script below will is used with a cross reference table with 8 columns. 

 

<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:template match="/">
<Row>
<xsl:call-template name="CrossRef"/>
</Row>
</xsl:template>
<xsl:template name="CrossRef" match="ref">
<xsl:text>GLNNR;NAVN;LEVNR;KRYDS;ALT_GLNNR;GLNNR_OPSLAG;ETSTYK;G-KOLLI</xsl:text>
<xsl:value-of select="'&#13;&#10;'" disable-output-escaping="yes"/>
<xsl:for-each select="/CrossReferenceRows/row">
<GLNNR>
<xsl:value-of select="Values/ref[@colIdx='0']/@value"/>
</GLNNR>
<xsl:text>;</xsl:text>
<NAVN>
<xsl:value-of select="Values/ref[@colIdx='1']/@value"/>
</NAVN>
<xsl:text>;</xsl:text>
<LEVNR>
<xsl:value-of select="Values/ref[@colIdx='2']/@value"/>
</LEVNR>
<xsl:text>;</xsl:text>
<KRYDS>
<xsl:value-of select="Values/ref[@colIdx='3']/@value"/>
</KRYDS>
<xsl:text>;</xsl:text>
<ALT_GLNNR>
<xsl:value-of select="Values/ref[@colIdx='4']/@value"/>
</ALT_GLNNR>
<xsl:text>;</xsl:text>
<GLNNR_OPSLAG>
<xsl:value-of select="Values/ref[@colIdx='5']/@value"/>
</GLNNR_OPSLAG>
<xsl:text>;</xsl:text>
<ETSTYK>
<xsl:value-of select="Values/ref[@colIdx='6']/@value"/>
</ETSTYK>
<xsl:text>;</xsl:text>
<G-KOLLI>
<xsl:value-of select="Values/ref[@colIdx='7']/@value"/>
</G-KOLLI>
<xsl:value-of select="'&#13;&#10;'" disable-output-escaping="yes"/>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>

Attachments

Outcomes