RE: Which one to choose

Subject: RE: Which one to choose
From: Mike Brown <mbrown@xxxxxxxxxxxxx>
Date: Wed, 16 Feb 2000 12:53:36 -0700
> I saw today several times the following construct:
> <xsl:variable name="foo" 
> select="document('http://remoteserver/file.xml')"/>
> <xsl:value-of select="$foo/path/to/some/nodes"/>
> 
> Is it because the XSLT engine used has some limitations? different
> interpretation of the recommendations?

No, it was just an example. I didn't want to provide examples of every
possible use of the document() function, so I picked the one that in my
opinion was the most useful. If you are going to be referring to a document
multiple times, it makes more sense to only call document() once and bind
the node-set it returns to a variable, then refer to that variable.

Like any other function, it returns an object of one of the types: node-set,
number, boolean, string, result tree fragment. You know that it returns a
node-set, so you can use it anywhere where you expect to see a node-set. So
it could be the first location step in an XPath expression. I am not aware
of any XSL processors (aside from IE) that would have any trouble with that.


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


Current Thread