Zargo
Programmer
- Mar 21, 2005
- 109
Dear all,
I have a XML Invoice like(=example):
<?xml version="1.0" encoding="UTF-8" ?>
- <Invoice xmlns:hrx="+ <Header>
- <Line>
<LineNumber>1</LineNumber>
<TotalAmount currency="EUR">+196.76</TotalAmount>
+ <Tax>
- <Line>
<LineNumber>10</LineNumber>
<TotalAmount currency="EUR">+196.76</TotalAmount>
<Description>Regular</Description>
+ <Price>
<ItemQuantity uom="Regular">+14.85</ItemQuantity>
</Line>
</Line>
+ <Line>
+ <Line>
</Invoice>
I have made a XSL and want to show all INVOICE\LINE and INVOICE\LINE\LINE items in a HTML table but without success. My XSL looks like:
<table border="0">
<tr bgcolor="#c0c0c0">
<th align="left">Linenumber</th>
<th align="left">Name</th>
<th align="left">Description</th>
<th align="left">Itemquantity</th>
<th align="left">Amount</th>
<th align="left">Multiplier</th>
<th align="left">Totalamount</th>
<th align="left">VAT %</th>
<th align="left">Linenumber header</th>
</tr>
<xsl:for-each select="Invoice/Line/Line">
<tr>
<td><xsl:value-of select="LineNumber"/></td>
<td><xsl:value-of select="UserArea/tc:Timecard/tc:ReportedResource/tc
erson/tc:LegalName"/></td>
<td><xsl:value-of select="UserArea/tc:Timecard/tc:ReportedTime/tc:TimeInterval/@type"/></td>
<td><xsl:value-of select="ItemQuantity"/></td>
<td><xsl:value-of select="Price/Amount"/></td>
<td><xsl:value-of select="UserArea/tc:Timecard/tc:ReportedTime/tc:TimeInterval/tc:RateOrAmount/@Multiplier"/></td>
<td><xsl:value-of select="TotalAmount"/></td>
<td><xsl:value-of select="//Invoice/Line/Tax/PercentQuantity"/></td>
<td><xsl:value-of select="//Invoice/Line/Linenumber"/></td>
</tr>
</xsl:for-each>
</table>
I have problems with the last two columns in my table:
<td><xsl:value-of select="//Invoice/Line/Tax/PercentQuantity"/></td> <td><xsl:value-of select="//Invoice/Line/Linenumber"/></td>
This two are not in //invoice/line/line but a level higher this info is in //invoice/line, how to get this info. Now i'm getting the following table:
10|A.R. SONAI|Regular|+21.57|+13.25|+0.00 |+285.80|19.00|1
21|A.R. SONAI| | | |+17.70| |19.00|1
10|A.C. REID |Regular|+21.23|+18.25|+0.00 |+87.45 |19.00|1
21|A.C. REID | | | | |+23.60 |19.00|1
10|A. WITH |Regular|+20.28|+19.00|+0.00 |+38.32 |19.00|1
Check the last two columns. I think i'm looping wrong(i must first loop into invoice\line and then in invoice\line\line). It gets only the first vat % and the linenumber header. How can i get the following lay-out?
10|A.R. SONAI|Regular|+21.57|+13.25|+0.00 |+285.80|19.00|1
21|A.R. SONAI| | | |+17.70| |19.00|1
10|A.C. REID |Regular|+21.23|+18.25|+0.00 |+87.45 | 6.00|2
21|A.C. REID | | | | |+23.60 | 6.00|2
10|A. WITH |Regular|+20.28|+19.00|+0.00 |+38.32 | 6.00|3
A big star for the golden tip.
TIA
I have a XML Invoice like(=example):
<?xml version="1.0" encoding="UTF-8" ?>
- <Invoice xmlns:hrx="+ <Header>
- <Line>
<LineNumber>1</LineNumber>
<TotalAmount currency="EUR">+196.76</TotalAmount>
+ <Tax>
- <Line>
<LineNumber>10</LineNumber>
<TotalAmount currency="EUR">+196.76</TotalAmount>
<Description>Regular</Description>
+ <Price>
<ItemQuantity uom="Regular">+14.85</ItemQuantity>
</Line>
</Line>
+ <Line>
+ <Line>
</Invoice>
I have made a XSL and want to show all INVOICE\LINE and INVOICE\LINE\LINE items in a HTML table but without success. My XSL looks like:
<table border="0">
<tr bgcolor="#c0c0c0">
<th align="left">Linenumber</th>
<th align="left">Name</th>
<th align="left">Description</th>
<th align="left">Itemquantity</th>
<th align="left">Amount</th>
<th align="left">Multiplier</th>
<th align="left">Totalamount</th>
<th align="left">VAT %</th>
<th align="left">Linenumber header</th>
</tr>
<xsl:for-each select="Invoice/Line/Line">
<tr>
<td><xsl:value-of select="LineNumber"/></td>
<td><xsl:value-of select="UserArea/tc:Timecard/tc:ReportedResource/tc
<td><xsl:value-of select="UserArea/tc:Timecard/tc:ReportedTime/tc:TimeInterval/@type"/></td>
<td><xsl:value-of select="ItemQuantity"/></td>
<td><xsl:value-of select="Price/Amount"/></td>
<td><xsl:value-of select="UserArea/tc:Timecard/tc:ReportedTime/tc:TimeInterval/tc:RateOrAmount/@Multiplier"/></td>
<td><xsl:value-of select="TotalAmount"/></td>
<td><xsl:value-of select="//Invoice/Line/Tax/PercentQuantity"/></td>
<td><xsl:value-of select="//Invoice/Line/Linenumber"/></td>
</tr>
</xsl:for-each>
</table>
I have problems with the last two columns in my table:
<td><xsl:value-of select="//Invoice/Line/Tax/PercentQuantity"/></td> <td><xsl:value-of select="//Invoice/Line/Linenumber"/></td>
This two are not in //invoice/line/line but a level higher this info is in //invoice/line, how to get this info. Now i'm getting the following table:
10|A.R. SONAI|Regular|+21.57|+13.25|+0.00 |+285.80|19.00|1
21|A.R. SONAI| | | |+17.70| |19.00|1
10|A.C. REID |Regular|+21.23|+18.25|+0.00 |+87.45 |19.00|1
21|A.C. REID | | | | |+23.60 |19.00|1
10|A. WITH |Regular|+20.28|+19.00|+0.00 |+38.32 |19.00|1
Check the last two columns. I think i'm looping wrong(i must first loop into invoice\line and then in invoice\line\line). It gets only the first vat % and the linenumber header. How can i get the following lay-out?
10|A.R. SONAI|Regular|+21.57|+13.25|+0.00 |+285.80|19.00|1
21|A.R. SONAI| | | |+17.70| |19.00|1
10|A.C. REID |Regular|+21.23|+18.25|+0.00 |+87.45 | 6.00|2
21|A.C. REID | | | | |+23.60 | 6.00|2
10|A. WITH |Regular|+20.28|+19.00|+0.00 |+38.32 | 6.00|3
A big star for the golden tip.
TIA