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

Re: Re: fn:collection and result-document problem

Subject: Re: Re: fn:collection and result-document problem
From: Robert Koberg <rob@xxxxxxxxxx>
Date: Mon, 24 Mar 2008 09:13:43 -0400
Re:  Re: fn:collection and result-document problem
On Mon, 2008-03-24 at 14:07 +0100, Martin Honnen wrote:
> Robert Koberg wrote:
> 
> > but this does not:
> > 
> > ...
> > <xsl:apply-templates 
> >   select="collection($jspx-includes-dir)" 
> >   mode="jspx"/>
> > ...
> > <xsl:template match="/" mode="jspx">
> >   <xsl:variable name="jspx-doc" select="."/>
> >   <xsl:variable name="page-path" 
> >     select="concat($output-dir, '/WEB-INF/jspx/',
> > tokenize(document-uri(/), '/')[last()])"/>
> >   <xsl:message>
> > JSPX: <xsl:value-of select="$page-path"/>:
> >   </xsl:message>
> >   <xsl:result-document href="{$page-path}">
> >     <xsl:apply-templates select="$jspx-doc"/>
> 
> I don't know how your template for root nodes (e.g. <xsl:template 
> match="/">) looks but here it is possible that you recursively process 
> your nodes again. I would rather expect you to use e.g.
>    <xsl:apply-templates select="$jspx-doc/node()" mode="jspx"/>
> here and then have templates filling the result document in mode="jspx".
> 

The transformation does reach the match="/" mode="jspx" template, but
fails to write the file producing the error:

"Cannot write more than one result document to the same URI, or write
to a URI that has been read: file:/path/to/my/source.xml ..."

That is why I don't understand. The temporary tree that I use
successfully to write the files (from the previous post) uses the exact
same source and destination URIs as the method above. Don't get it...

thanks,
-Rob

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.