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

Re: Appending to existing file

Subject: Re: Appending to existing file
From: Ronan Klyne <ronan.klyne@xxxxxxxxxxx>
Date: Tue, 17 Jul 2007 16:48:09 +0100
Re:  Appending to existing file
Michael Kay wrote:
>> Michael, I would find that a tempting approach, however, in 
>> your first paragraph, you state that everything can be 
>> executed in an undefined order. I assume that means, in 
>> theory *and* in practice, that the order in which the 
>> OutputURIResolver is called is undefined and hence, the order 
>> of the snippets that you are writing to the same target.
>>
>> Obviously, by collecting the data before writing it, you can 
>> order it by means of some sort of identifier of course.
> 
> Actually, the language imposes rules on when you can call
> xsl:result-document. In effect, you can only call it at a point where you
> would otherwise be writing to a final result tree. You can't call it while
> evaluating a variable or function, which are the kind of areas where lazy
> evaluation often comes into play. Since writing to the final result tree is
> likely to be a fairly sequential process, this means there's a pretty good
> chance (especially if you don't "nest" result documents) that the processor
> is actually going to handle xsl:result-document instructions in the
> "natural" order. So you're running a little bit of a risk by relying on the
> order, and I can't judge what risks are acceptable to any particular
> project, but in most situations I would be prepared to chance it.
> 
> Michael Kay
> http://www.saxonica.com/
> 
> 

Would it not be possible to use the fragment to specify the order, and
have the resolver return a StreamResult which forwarded all data to a
'master' object, and have that object handle writing the file?
If not, I'd be interested to know why...

	# r

-- 
Ronan Klyne
Business Collaborator Developer
Tel: +44 (0)870 163 2555
ronan.klyne@xxxxxxxxxxx
www.groupbc.com

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.