[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Identity of Documents Puzzle

Subject: RE: Identity of Documents Puzzle
From: "Michael Kay" <michael.h.kay@xxxxxxxxxxxx>
Date: Mon, 9 Dec 2002 09:33:23 -0000
RE:  Identity of Documents Puzzle
> This is all tested with Saxon 6.5.2 and depends on, at a 
> minimum, that 
> multiple calls to document() with the same URL will result in 
> the same 
> document node instance (and ideally, calls to the same file system 
> object (e.g., inode in *nx file systems) would result in the same 
> document node instance).
> 
> My question: is there any way, other than passing in the 
> filename of the 
> top-level file as a parameter to the style sheet, to ensure that the 
> node for the document as created by the initial style sheet 
> processing 
> is the same as one for a call to document() for the same file 

First point is, that "the same file" is not a concept that any XSLT
processor will recognize. The closest you can get it "the same URI". No
XSLT processor is going to recognize that http://saxon.sf.net/index.html
is the same file as http://saxon.sourceforge.net/index.html

The rule that two calls on document() supplying the same absolute URI
will return the same document node is defined in the XSLT spec, and most
processors are likely to implement it using some kind of mapping table
from URIs to nodes. In Saxon this is referred to as the "document pool".

Saxon doesn't include the initial input document in the document pool.
There is no requirement in the XSLT spec that says it should, though I
think there is also no requirement that prevents it, in those cases
where the absolute URI is known. If you want, you can add it yourself
using ((Controller)transformer).getDocumentPool().add(x,y). You could
also intercept the call on document() by means of a user-written
URIResolver, which would be a more portable solution.

Michael Kay
Software AG
home: Michael.H.Kay@xxxxxxxxxxxx
work: Michael.Kay@xxxxxxxxxxxxxx 


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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.