Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 23rd, 2008, 12:13 AM
Authorized User
 
Join Date: Jul 2008
Posts: 53
Thanks: 0
Thanked 0 Times in 0 Posts
Default <xsl:key

The tag "<xsl:key name="by-id" match="Att[@Ty='TM']" use="@Id"/>" is working fine with single input xml file. But i have issues in multiple input xml file. Is it possible to handle the multiple input xml in <xls:key ...? such as

<xsl:key name="by-id" match="document(/Envelope/Part/@File)/Invoice/InvoiceItem/AggSet/Att[@Ty='TM']" use="@Id"/>

i am getting ERROR: 'Syntax error in 'document(/Envelope/Part/@File)/Invoice/InvoiceItem/AggSet/Att[@Ty='TM']'.'

[u]All input xml file defined in one single xml file as follows,</u><?xml version="1.0" encoding="UTF-8"?>
<Envelope>
<Part File='TestJS.xml' LinkType='REL' DocType='INV' Format='XML'/>
</Envelope>
 
Old July 23rd, 2008, 05:00 AM
Authorized User
 
Join Date: Jul 2008
Posts: 53
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Please find more details as follows,

<xsl:key name="by-id" match="Att[@Ty='TM']" use="@Id"/>

<xsl:for-each select="/Document/Invoice/InvoiceItem/AggSet/Att[@Ty='TM'][generate-id() = generate-id(key('by-id', @Id)[1])]"> *****1*****
 Invoked....
</xsl:for-each>

If i used doucment() to load the xml file, its not working such as

<xsl:for-each select="document(/Envelope/Part/@File)/Document/Invoice/InvoiceItem/AggSet/Att[@Ty='TM'][generate-id() = generate-id(key('by-id', @Id)[1])]"> *****1*****
     Not Working...
</xsl:for-each>





Similar Threads
Thread Thread Starter Forum Replies Last Post
Global variable restrictions in the <xsl:key> iceandrews XSLT 2 August 25th, 2008 01:16 PM
Using key() and <xsl:key> freddy XSLT 2 January 18th, 2007 08:55 PM
<bean:message key="PNR.INPUT"/> key has null value warsha_14 Struts 1 November 13th, 2006 07:26 AM
<xsl:for-each> and key() - help needed muchofrio XSLT 5 April 13th, 2006 09:28 AM
<xsl:key> prints extra string? di98svpa XSLT 6 February 6th, 2006 12:13 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.