Subject: Re: [xsl] referring to variables using variables? From: David Carlisle <davidc@xxxxxxxxx> Date: Tue, 13 Jan 2004 11:15:28 GMT |
Thanks very much for your help so far, just wanted to make absolutely sure i understand the select statement in the for-each element select="xx:node-set($index)/*", does it mean that every variable in index is a node and if so why do you have to do that? Michael's solution using xx:node-set() was the same as teh one I posted using document(). It isn't that "every variable in index is a node" $index is a single variable, with value a node set. "node set" is the main Xpath type and is the only type that you can apply path expressions using / to (The other Xpath types being number, boolean and string) You can not, in XSLT 1 construct a new node set, only subset (using selct expressions) node sets corresponding to input documents. So to get a suitable node set, I suggested making a second input document and including it with document() which gives a node set consisting of a single document node, michael suggested putting similar information in a variable (which produces a result tree fragment) and then converting that to a node set with a single document node using a node-set extension function. Either way you end up with an in-mempry document that you can use as a lookup table mapping from names to uris. You don't need to explictly iterate over the table as the document() function is designed to accespt a set of nodes as its argument, in that case it takes the string value of each node, and interprets it as a uri, and returns the document resulting from fetching that uri. David -- http://www.dcarlisle.demon.co.uk/matthew ________________________________________________________________________ This e-mail has been scanned for all viruses by Star Internet. The service is powered by MessageLabs. For more information on a proactive anti-virus service working around the clock, around the globe, visit: http://www.star.net.uk ________________________________________________________________________ XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] referring to variables us, james walker | Thread | RE: [xsl] referring to variables us, Michael Kay |
RE: [xsl] referring to variables us, james walker | Date | RE: [xsl] referring to variables us, james walker |
Month |