|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Choosing content depending on content of other ele
Hi Jochen, > No I have the nodes /root/output/data/product_id and order/product > > Depending on the product_id output, I wan't to choose the equivalent > node > > /root/order/product/@id='xxx'/content/@group You're almost there with: /root/order/product[@id='/root/output/data/product_id'] The only problem is that you're comparing the id attribute of the product with *the string* '/root/output/data/product_id' rather than *the value of* the product_id element that you're selecting. Just remove the quotes, and it should work: /root/order/product[@id=/root/output/data/product_id] although it would be more efficient to hold the value of /root/output/data/product_id in a variable and then reference that. By the way, if the only products to which you're apply templates are those that have the correct id, then there's no point testing whether they have the correct id when you try to match them with a template *as well*. Also, from what I can see, the only product elements are those within the order, so you may as well have the template just match any product element; the only ones it will process are the ones you apply templates to: <xsl:template match="product"> <br/><xsl:value-of select="content/@group"/> </xsl:template> Cheers, Jeni --- Jeni Tennison http://www.jenitennison.com/ XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








