xsl-list
[Top] [All Lists]

Re: document function in xslt

2003-03-21 00:56:53
Stevenson Ngila wrote:
does the use of this document function lower the speed of my application?
i.e. if i have:

<><><><><><><><><><><><><><><><>
<xsl:variable name="config-top" select="document( 'names.xml' )/config"/>
<><><><><><><><><><><><><><><><>

does it act as a variable where by onces set it doesn't depend on the
availability of names.xml document any more?

It should not make a difference whether you call document() once and bind its
result to a variable, or call it separately each time where you need it.
Emphasis on "should"...

Even if you call document() more than once, processors are required to
implement it in a way that always returns an identical root node, and thus the
same document, for the given URI. You should not assume that your processor is
conformant, though. I have seen some, uh, variability in this regard.
The way you are doing it is probably safer, even though it shouldn't make
a difference.

Mike

-- 
  Mike J. Brown   |  http://skew.org/~mike/resume/
  Denver, CO, USA |  http://skew.org/xml/

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



<Prev in Thread] Current Thread [Next in Thread>