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

Re: fn:collection and result-document problem

Subject: Re: fn:collection and result-document problem
From: Robert Koberg <rob@xxxxxxxxxx>
Date: Mon, 24 Mar 2008 07:16:17 -0400
Re:  fn:collection and result-document problem
> Probably two files in the input collection with the same name but
> different path... with the code above that would result in the same
> $path-path for both.
> 

Nope, the input files are all in the same directory (no duplicates).

I have worked around it by creating a temporary tree that lists each
file and its from and to location and applying templates on it, which
does work.

I must be missing something about collection??

best,
-Rob

On Mon, 2008-03-24 at 11:00 +0000, Andrew Welch wrote:
> On 24/03/2008, Robert Koberg <rob@xxxxxxxxxx> wrote:
> > Hi,
> >
> >  I am trying to transform a directory of XML files from one directory to
> >  another. The XSL below fails with an error saying:
> >
> >   "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 ..."
> >
> >  If I comment out the result-document instructions, the xsl:message list
> >  all of the unique file paths. In other words, I am not trying to write
> >  more than one result document to the same URI or trying to write to a
> >  URI that has been read. What am I doing wrong?
> >  ...
> >  <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"/>
> >   </xsl:result-document>
> >  </xsl:template>
> 
> Probably two files in the input collection with the same name but
> different path... with the code above that would result in the same
> $path-path for both.
> 
> cheers

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.