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]
Other format: [Raw text]

Re: RE:read-write same url in xslt 2 [was appendig to multiple output files]


>
>>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@melvaig.co.uk

 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]