This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: Including a document


>   The reason I am not interested in calling document() twice,
> is because
> every time document is called, "B.xml" is read, parsed etc.
> and suppose
> if B.xml is a very large file, doing it twice seems a waste
> of resources.

The processor shouldn't do that: if you call document() twice with the same
URI, it's obliged to return the same root node each time (so
count(document('A.xml')|document('A.xml')) is guaranteed to be 1).

But it's not a bad idea to put the call on document in a global variable
anyway:

<xsl:variable name="B.xml" select="document('B.xml')"/>

and then you can replace your calls on document('B.xml') with a reference to
$B.xml

Mike Kay
Software AG


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]