[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: RE:read-write same url in xslt 2 [was appendig to
> >>This reminds me that we haven't said anything in XSLT 2.0 about what >happens >>if you try to read and write the same URL within a single transformation. >We >>will have to say it's an error, but whether we say the processor has to >>detect it and report it is another question. > >why does it have to be an error? it works with Saxon if you're using >version="1.1" > How do you mean 'works' ? If you have document('x') in your stylesheet this will see 'x' as it exists *before* the transformation. If you also have xsl:document href="x" then this new 'x' doesn't get written until the result tree is serialised. I do not think that is what you are expecting? Thats how Saxon works, because it puts the output in a temporary tree which does not get serialized until it is complete: it would be wrong for the specification to *require* that the creation of the new 'x' should be delayed in this way - it is possible and maybe useful to write a processor which writes the output to file as soon as it can, in which case document('x') could see a half-written file. The difficulty about making this a 'required error' is that the XSLT processor does not understand all possible URI schemes: so it cannot be made responsible for detecting that two apparently different relative URIs actually refer to the same resource. Then add URI resolvers into the equation... Summary- its a mistake to do this, even if it appears to work for a particular processor. Regards, Trevor Nash -- Traditional training & distance learning, Consultancy by email Melvaig Software Engineering Limited voice: +44 (0) 1445 771 271 email: tcn@xxxxxxxxxxxxx XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
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
|