Re: [xsl] First attempt at xsl:result-document

Subject: Re: [xsl] First attempt at xsl:result-document
From: Spencer Tickner <spencertickner@xxxxxxxxx>
Date: Mon, 25 Apr 2005 11:15:07 -0700
After more review I think my problem lies in the fact that section and
clause are not embedded in part. Is there anyway of distinguishing in
a for-each statement that you want to apply templates for all tags
between the distinct part tags, whether they are children of part or
not? Any suggestions would be very appreciated.

Spencer

On 4/25/05, Spencer Tickner <spencertickner@xxxxxxxxx> wrote:
> Hi Jay,
>
> Thanks for the response. I did try stripping out the file:/// and I
> get a java.lang.RuntimeException: "Resolved URL is malformed". This
> may be because I tried to really strip down my code to make my problem
> more visible on the list. in truth the variable is something more like
> <xsl:variable name="filname"
> select=concat('file:///W:/test/testing/b/, $myindex, '_', position(),
> '.htm')"/>
>
>
> On 4/25/05, JBryant@xxxxxxxxx <JBryant@xxxxxxxxx> wrote:
> > Hi, Spencer,
> >
> > When I tried your XML and XSL files (after filling in the necessary
> > pieces), I found that I got no output unless I removed the "file:///"
part
> > of the href value.
> >
> > Jay Bryant
> > Bryant Communication Services
> > (presently consulting at Synergistic Solution Technologies)
> >
> > Spencer Tickner <spencertickner@xxxxxxxxx>
> > 04/25/2005 11:59 AM
> > Please respond to
> > xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> >
> > To
> > xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> > cc
> >
> > Subject
> > [xsl] First attempt at xsl:result-document
> >
> >
> > Hi everyone, and thanks in advance for the help.
> >
> > I have a magical and wonderful xsl that was doing everything I needed
> > it too. Unfortunately as this buisness goes, requirements changed.
> > Some of the html documents I was producing were getting too large for
> > our website. The decision was made to split the larger ones up by
> > part. So after some research I found xsl:result-document. Here is some
> > sample xml, my single file xsl transformer and my attempt at
> > multi-file transformation.
> >
> > xml
> >
> > <act>
> > <part>this is a part we will divide a file on</part>
> > <section>This is a section</section>
> > <clause>This is a clause</clause>
> > <part>This is another part, in the new scheme of things, a second
> > file</part>
> > <section>Yet another section</section>
> > </act>
> >
> > original xsl (works fine)
> >
> > <xsl:template match="act">
> >
> > <html>
> > <body>
> > <xsl:apply-templates mode="tableofcontents"/>
> > <xsl:apply-templates mode="content"/>
> > </body>
> > </html>
> >
> > </xsl:template>
> > <!-- Down here of course I have the templates that apply the styles
> > for either mode -->
> >
> > new xsl (well, not so fine)
> >
> > <xsl:template match="act">
> >
> > <xsl:result-document href="file:///toc.html" format="html">
> > <html>
> > <body>
> > <xsl:apply-templates mode="tableofcontents"/>
> > </body>
> > </html>
> > </xsl:result-document>
> >
> > <xsl:for-each select="part">
> > <xsl:variable name="filename" select="concat('file:///', position(),
> > '.htm'"/>
> > <xsl:result-document href={$filename}" format="html">
> > <html>
> > <body>
> > <xsl:apply-templates mode="content"/>
> > </body>
> > </html>
> > </xsl:result-document>
> > </xsl:for-each>
> > </xsl:template>
> >
> > <!-- Exact same  templates that apply the styles for either mode as
> > original xsl -->
> >
> > In the new xsl, I get the tableof contents no problem. in terms of
> > content I get a number of files (same as the number of parts) with no
> > content in them. I realize that the for-each statement probably
> > doesn't do what I'm hoping it will do, but I can't quite wrap my mind
> > around any other ways of doing this. I would really appreciate any
> > suggestions or advice.
> >
> > Thank you all very much,
> >
> > Spencer

Current Thread