XSL choose several

Here should go questions about transforming XML with XSLT and FOP.
tAnd
Posts: 5
Joined: Thu Dec 20, 2018 1:27 pm

XSL choose several

Post by tAnd » Mon Mar 25, 2019 5:59 pm

I am currently stuck at a problem with xsl.
Example:
XML:

<Idoc>
- <invoice01>
- <asd>000010</asd>
- <jkl>12</jkl>
- </invoice01>
<Idoc>

The problem is that i have around 100 files with different information in <asd> and i want to differentiate by that value.

xsl:
<xsl:stylesheet>
<Order>
<xsl:for-each select="/Idoc/invoice01">
<xsl:if test="ASD=000010">
<cbc:Quantity><xsl:value-of select="/Idoc/invoice01[asd='000010']/jkl"/></cbc:Quantity>

A different xml file could be:

<Idoc>
- <invoice01>
- <asd>000090</asd>
- <jkl>12</jkl>
- </invoice01>
- <invoice02>
- <asd>000080</asd>
- <jkl>20</jkl>
- </invoice02>
<Idoc>

I am therefor looking for a way to separate the information, but also be able to apply several quantities if needed.

tAnd
Posts: 5
Joined: Thu Dec 20, 2018 1:27 pm

Re: XSL choose several

Post by tAnd » Tue Mar 26, 2019 1:27 pm

it should be said i am working in xsl:stylesheet version 1.0 encoding utf-8

Post Reply