Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
04-03-2012, 05:34 PM #1
- Join Date
- Apr 2012
- Thanked 0 Times in 0 Posts
Creating Multiple Outputs with XSL/XML?
Forgive me if I worded the title incorrectly, I am still learning the basics of xml/xsl and had a few questions about a project I am working on.
I have created a xml template I am using with some shipping software to produce a invoice and label. On the invoice I need barcodes for our items, I have figured out how to display the barcodes, but when I have an order with multiple items, it just duplicates the first output barcode.
Here is the code I am using, again forgive me if it's horribly formatted.
<xsl:for-each select="$order/Item/SKU"> <table border="0" align="center"> <tr> <td><center><font style="font-family:Free 3 of 9 Extended; font-size:24pt; font-weight:normal;">*<xsl:value-of select="$order/Item/SKU" />*</font></center></td> <td><center><font style="font-family:; font-size:12pt; font-weight:normal;"><xsl:value-of select="$order/Item/Code" /></font></center></td> </tr></table></xsl:for-each>
Thank you in advance for any help!!
04-04-2012, 09:45 AM #2
- Join Date
- Jan 2010
- Behind the Wall
- Thanked 532 Times in 526 Posts
if $order is supposed to be a (PHP) variable, that won’t work.
inside the for-each loop you can access the currently processed element by
.(i.e. for-each opens a new scope)The computer is always right. The computer is always right. The computer is always right. Take it from someone who has programmed for over ten years: not once has the computational mechanism of the machine malfunctioned.André Behrens, NY Times Software Developer