|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: document() path relative to current document
Hi Robert, > I believe that you and David are right, BUT how can I make the value of an > attribute @href a node-set? > > I have <a href="folder/foo.html"> and want to read data from that external > file. I save the url to a variable by using <xsl:variable name="bar" > select="@href"/>. So $bar is still just a string. > select="@href"/> When I provide this to the > document function by document($bar,/) i suppose it will not magically become > a nodeset. You're missing the point. An XPath location path such as "foo/bar", "//baz" or "@href" returns a node-set. In some circumstances, that node-set might get converted to a string, for example when you use it as one of the arguments to the concat() function, but if you set a variable like: <xsl:variable name="bar" select="@href" /> then the value of the $bar variable is a node-set. The node-set held by the $bar variable contains a single node: the href attribute of the current node. The $bar variable does not contain a string. (I say this repeatedly in as many ways as I can just to drum it in.) When you provide it to the document function as in: document($bar) the argument to the document() function is a node-set, not a string. Therefore it should work in exactly the way that David and Mike have told you it should work. If it doesn't work in that way, you need to start looking for other reasons why not. Cheers, Jeni --- Jeni Tennison http://www.jenitennison.com/
|
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








