[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Keys across multilple input files

Subject: RE: Keys across multilple input files
From: Ann Marie Rubin - Sun PC Networking Engineering <Annmarie.Rubin@xxxxxxxxxxxx>
Date: Fri, 2 Jun 2000 15:41:30 -0400 (EDT)
xsl key across files
	From: Kay Michael <Michael.Kay@xxxxxxx>
	To: "'xsl-list@xxxxxxxxxxxxxxxx'" <xsl-list@xxxxxxxxxxxxxxxx>
	Subject: RE: Keys across multilple input files
	MIME-Version: 1.0
	
	> 1.  Can I use the xsl:key element to generate keys for CLASS 
	> elements that are each contained in separate files?
	
	Not in any useful way. The key() function can only be used to find nodes in
	the current document.
	   
	  ** But, I thought you could use the <xsl:for-each> statement 
	  ** with the document() function to change the current context 
	  ** node to the root node in different file.  Then, you could
	  ** use the key() function to access the keys in the remote
	  ** file.  Have I misunderstood?
	
	> I tried the following:
	> 
	> <xsl:for-each select="document('filelist.xml')">
	> <xsl:key name="classes" match="class" use="@NAME"/>
	> </xsl:for-each>
	
	You're confusing the key definition (<xsl:key>) which is a top-level
	element, and the key() function, which is used to retrieve nodes using the
	key.
	
	** You are right about that.  I thought the key() function 
	** generates keys, and the <xsl:key> statement retrieves them.
	** I was trying to generate keys for elements that exist in
	** multiple external files.  I didn't know if it was even possible.
	
	> 2.  Can I generate the keys for all CLASS elements in one XSL 
	> process and save them, so that another XSL process can access these keys?
	
	You could generate an XML document that acts as an index, and reference this
	document in a subsequent run using the document() function. But you can't
	save the key index per se.
	 
	** How would I do this? Would I need to use the key() function 
	** to generate keys for all CLASS elements containing in 
	** a single XML document.  Then, in subsequent runs of the
	** stylesheet for ian ndividual XML class files, use the document()
	** function with <xsl:key> to access the indexed CLASS elements
	** in the remote file?
	
	Ann Marie
	
	Mike K
	
	
	 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list




 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.