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

Re: Cannot write more than one result document to the

Subject: Re: Cannot write more than one result document to the same URI
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Thu, 04 Apr 2013 21:52:01 -0400
Re:  Cannot write more than one result document to the
At 2013-04-04 16:46 -0700, Dan Vint wrote:
I guess what I'm expecting is that the result document is closed once the </xslt:result-document> end tag is found.

Yes, it is.

Instead XSLT seems to keep this memory around that it is there.

No, not in memory.

I'm happy with just over writing the last file created as it is all the same content each time.

Fine ... if you can make the assumption that the same conref attribute will create the same output, then I have a suggestion for you.

Yeah maybe inefficient, but I expected it to work. Out of 3000 files I have to process with lots of need for this file splitting I found 2 that complain about writing to the same result document.

But that complaint isn't superfluous, it is explicit in the specification:

  [ERR XTDE1490] It is a non-recoverable dynamic error for
  a transformation to generate two or more final result
  trees with the same URI.

With the first posting I wasn't sure where in the processing this was occurring, then I found the files that actually were trying to create the file twice. I still don't understand why this is a problem when the output file should be closed by the time the next write sequence is started.

It isn't a problem with the implementation, it is a formal aspect of the specification as cited above.

Could you simply check back to make sure you haven't already created the file?

   <xsl:if test="not(preceding::*[@conref=current()/@conref])">
     <xsl:result-document href=.......

So, for every unique conref attribute you'll get only a single invocation of <xsl:result-document>.

I hope this helps.

. . . . . . . . . Ken

Contact us for world-wide XML consulting and instructor-led training |
Free 5-hour lecture: http://www.CraneSoftwrights.com/links/udemy.htm |
Crane Softwrights Ltd.            http://www.CraneSoftwrights.com/s/ |
G. Ken Holman                   mailto:gkholman@xxxxxxxxxxxxxxxxxxxx |
Google+ profile: https://plus.google.com/116832879756988317389/about |
Legal business disclaimers:    http://www.CraneSoftwrights.com/legal |

Current Thread


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.
First Name
Last Name
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.