Hi everybody,
I have an xml file that looks like this:
<?xml version="1.0"?>
<?xml-stylesheet href="WAstylesheet.xsl" type="text/xsl"?>
<order no="809819">
<Sender>Karim Abdul Jabbar</Sender>
<orderNo>809819</orderNo>
<orderDate>2002/01/22</orderDate>
<orderPoint>6004930005005</orderPoint>
<invoicePoint>6004930001575</invoicePoint>
<supplierPoint>6004931241000</supplierPoint>
<deliveryDates>
<earliest>2002/01/22</earliest>
<latest>2002/01/31</latest>
</deliveryDates>
<transactionCode>Transaction Code</transactionCode>
<narrative>
<styleID>40:03:02:01:99:13</styleID>
<desc>GIRLS UNDERWEAR</desc>
<buyerName>RENSKE KRUGER</buyerName>
<totalOrderQty>2000</totalOrderQty>
<reqNo>809819</reqNo>
<daysToPay>90 DAYS</daysToPay>
<distributionDiscount>4.00</distributionDiscount>
<fabric>SINGLE JERSEY</fabric>
<packSize>5</packSize>
<packing>SOLID COLOUR, SOLID SIZE</packing>
</narrative>
[red] <Product id="555-000004">
<Prod_Code>555-000004</Prod_Code>
<Colour>Blue</Colour>
<Qty_Ordered>4</Qty_Ordered>
<Size>Large</Size>
<Price>R40.00</Price>
<sellPrice>R46.00</sellPrice>
<prTotal>R160.00</prTotal>
</Product>
<Product id="777-000004">
<Prod_Code>777-000004</Prod_Code>
<Colour>Green</Colour>
<Qty_Ordered>12</Qty_Ordered>
<Size>36cm</Size>
<Price>R40.00</Price>
<sellPrice>R46.00</sellPrice>
<prTotal>R160.00</prTotal>
</Product>
<Product id="888-000004">
<Prod_Code>888-000004</Prod_Code>
<Colour>Assorted</Colour>
<Qty_Ordered>100</Qty_Ordered>
<Size>11/12</Size>
<Price>R40.00</Price>
<sellPrice>R46.00</sellPrice>
<prTotal>R160.00</prTotal>
</Product> [/red]
<orTotal>210</orTotal>
</order>
Now, for each occurance of the Product element, I have an xsl to represent it. The problem I'm experiencing is that I need to create a display that pertains to that specific Product element, however, I also need to incorporate info which comes from sibling elements.(hope that makes sense).
Can anyone tell me how I can 'loop' through the Product elements and create a seperate representation of each??
heres my xsl as it stands now:
<?xml version='1.0'?><xsl:stylesheet version="1.0" exclude-result-prefixes="xsl msxsl" xmlns:xsl=" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:sql="urn:schemas-microsoft-com:xml-sql" xmlns:xsi=" <xsl:template match="/"> <HTML>
<HEAD>
<link rel="stylesheet" href="textStyles.css" type="text/css"/>
</HEAD> <BODY BGCOLOR="#FFFFFF" TEXT="black" LINK="#FF0000" VLINK="#0000FF" >
<xsl:for-each select="order">
<CENTER>
<table width="100%" border="0" align="center">
<tr>
<td align="left">
<h1><font face="Times New Roman, Times, serif"><b>P/O : <xsl:value-of select="orderNo"/></b></font></h1>
</td>
</tr>
<tr>
<td height="99">
<h3>STYLE : <xsl:value-of select="narrative/styleID"/></h3>
<br/>
<h4><xsl:value-of select="narrative/desc"/></h4>
</td>
</tr>
<tr>
<td>
<h2>SKU : <xsl:value-of select="Product/Prod_Code"/></h2>
<h2>SIZE : <xsl:value-of select="Product/Size"/></h2>
<h2>COLOUR : <xsl:value-of select="Product/Colour"/></h2>
<h2>QTY : <xsl:value-of select="Product/Qty_Ordered"/></h2>
</td>
</tr>
<tr>
<td>
<table width="80%" align="left">
<tr>
<td rowspan="2" width="40%">barcode</td>
<td width="70%" align="center">
<h4>Carton Number : </h4>
</td>
<td width="100" align="center">
<table width="75" border="1" height="75">
<tr>
<td></td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="center">
<h4>Quality Checked :</h4>
</td>
<td align="center" width="100">
<table width="75" border="1" height="75">
<tr>
<td></td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="3"></td>
</tr>
</table>
<br/>
</td>
</tr>
<tr>
<td align="left">
<table width="80%" border="0">
</table>
</td>
</tr>
</table>
</CENTER>
</xsl:for-each>
</BODY>
</HTML>
</xsl:template>
</xsl:stylesheet>
Any assistance would be a great help.
Thank you
God Bless
Mike
I have an xml file that looks like this:
<?xml version="1.0"?>
<?xml-stylesheet href="WAstylesheet.xsl" type="text/xsl"?>
<order no="809819">
<Sender>Karim Abdul Jabbar</Sender>
<orderNo>809819</orderNo>
<orderDate>2002/01/22</orderDate>
<orderPoint>6004930005005</orderPoint>
<invoicePoint>6004930001575</invoicePoint>
<supplierPoint>6004931241000</supplierPoint>
<deliveryDates>
<earliest>2002/01/22</earliest>
<latest>2002/01/31</latest>
</deliveryDates>
<transactionCode>Transaction Code</transactionCode>
<narrative>
<styleID>40:03:02:01:99:13</styleID>
<desc>GIRLS UNDERWEAR</desc>
<buyerName>RENSKE KRUGER</buyerName>
<totalOrderQty>2000</totalOrderQty>
<reqNo>809819</reqNo>
<daysToPay>90 DAYS</daysToPay>
<distributionDiscount>4.00</distributionDiscount>
<fabric>SINGLE JERSEY</fabric>
<packSize>5</packSize>
<packing>SOLID COLOUR, SOLID SIZE</packing>
</narrative>
[red] <Product id="555-000004">
<Prod_Code>555-000004</Prod_Code>
<Colour>Blue</Colour>
<Qty_Ordered>4</Qty_Ordered>
<Size>Large</Size>
<Price>R40.00</Price>
<sellPrice>R46.00</sellPrice>
<prTotal>R160.00</prTotal>
</Product>
<Product id="777-000004">
<Prod_Code>777-000004</Prod_Code>
<Colour>Green</Colour>
<Qty_Ordered>12</Qty_Ordered>
<Size>36cm</Size>
<Price>R40.00</Price>
<sellPrice>R46.00</sellPrice>
<prTotal>R160.00</prTotal>
</Product>
<Product id="888-000004">
<Prod_Code>888-000004</Prod_Code>
<Colour>Assorted</Colour>
<Qty_Ordered>100</Qty_Ordered>
<Size>11/12</Size>
<Price>R40.00</Price>
<sellPrice>R46.00</sellPrice>
<prTotal>R160.00</prTotal>
</Product> [/red]
<orTotal>210</orTotal>
</order>
Now, for each occurance of the Product element, I have an xsl to represent it. The problem I'm experiencing is that I need to create a display that pertains to that specific Product element, however, I also need to incorporate info which comes from sibling elements.(hope that makes sense).
Can anyone tell me how I can 'loop' through the Product elements and create a seperate representation of each??
heres my xsl as it stands now:
<?xml version='1.0'?><xsl:stylesheet version="1.0" exclude-result-prefixes="xsl msxsl" xmlns:xsl=" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:sql="urn:schemas-microsoft-com:xml-sql" xmlns:xsi=" <xsl:template match="/"> <HTML>
<HEAD>
<link rel="stylesheet" href="textStyles.css" type="text/css"/>
</HEAD> <BODY BGCOLOR="#FFFFFF" TEXT="black" LINK="#FF0000" VLINK="#0000FF" >
<xsl:for-each select="order">
<CENTER>
<table width="100%" border="0" align="center">
<tr>
<td align="left">
<h1><font face="Times New Roman, Times, serif"><b>P/O : <xsl:value-of select="orderNo"/></b></font></h1>
</td>
</tr>
<tr>
<td height="99">
<h3>STYLE : <xsl:value-of select="narrative/styleID"/></h3>
<br/>
<h4><xsl:value-of select="narrative/desc"/></h4>
</td>
</tr>
<tr>
<td>
<h2>SKU : <xsl:value-of select="Product/Prod_Code"/></h2>
<h2>SIZE : <xsl:value-of select="Product/Size"/></h2>
<h2>COLOUR : <xsl:value-of select="Product/Colour"/></h2>
<h2>QTY : <xsl:value-of select="Product/Qty_Ordered"/></h2>
</td>
</tr>
<tr>
<td>
<table width="80%" align="left">
<tr>
<td rowspan="2" width="40%">barcode</td>
<td width="70%" align="center">
<h4>Carton Number : </h4>
</td>
<td width="100" align="center">
<table width="75" border="1" height="75">
<tr>
<td></td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="center">
<h4>Quality Checked :</h4>
</td>
<td align="center" width="100">
<table width="75" border="1" height="75">
<tr>
<td></td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="3"></td>
</tr>
</table>
<br/>
</td>
</tr>
<tr>
<td align="left">
<table width="80%" border="0">
</table>
</td>
</tr>
</table>
</CENTER>
</xsl:for-each>
</BODY>
</HTML>
</xsl:template>
</xsl:stylesheet>
Any assistance would be a great help.
Thank you
God Bless
Mike