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

Re: Appending output to multiple documents

Subject: Re: Appending output to multiple documents
From: Daniel Veillard <Daniel.Veillard@xxxxxxx>
Date: Tue, 12 Jun 2001 10:38:03 +0200
xslt twice output
[ Forwarded to xsl-editors from xsl-list post by
  "Rafael R. Sevilla" <sevillar@xxxxxxxxxxxxxxxxx> , Daniel ]

On Tue, Jun 12, 2001 at 03:53:48PM +0800, Rafael R. Sevilla wrote:
> 
> Been playing a bit with Saxon and its partial implementation of the XSLT
> 1.1 draft.  here. I've been wondering if there is a way for multiple
> <xsl:document/> constructions that reference the same file to *append*
> their outputs to the file instead of truncating the original file and
> replacing its contents.  Useful for the case where I had two different
> templates that had to spew their output to the same file, in the order
> they were matched.  Is there something in the standard I missed, or is
> this currently impossible and I would need to hack my XSLT processor and
> then propose to the W3C a mode attribute to <xsl:document/> that would
> control whether output to files that already exist should be appended or
> overwritten?

  Hum, that's an interesting point.
  The proper way to give feedback to the XSL WG is to send the message
to the feedback list associated to this specification xsl-editors@xxxxxx
(I've Cc'ed them).

  http://www.w3.org/TR/xslt11/#multiple-output
  last paragraph says:

----------------------
It is an error if the set of documents to be output as the result of a
single XSLT transformation (that is, the main result document and its
subsidiary documents recursively) contain two documents with the same
output URI.
----------------------

  So the current draft actaully forbids what you are suggesting.

  Note however that the resource being written to is referenced by an
URI-Reference, and hence can point to any kind of Web resource, and
it is sometimes very difficult (impossible) to know if 2 URI-References 
point to the same resource and how opening them twice for writing would
work in practice (I assume file:// would overwrite the content in most
cases but irc:// would just generate the content twice).

  Though the XSLT-1.1 draft is no longer maintained (this is public
knowledge but not stated at http://www.w3.org/TR/xslt11 ) it would
be useful that the next XSLT revision (if it include xsl:document)
add something about the impossibility to guess if 2 different output URI
are actually the same resource (and the hazard which can results when
this happens). 

Daniel

-- 
Daniel Veillard      | Red Hat Network http://redhat.com/products/network/
veillard@xxxxxxxxxx  | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/

 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.