xsl-list
[Top] [All Lists]

Re: First attempt at xsl:result-document

2005-04-25 13:53:10
Excellent,

Thank you Michael, it looks like that's exactly what I'm looking for.
Thanks for the time and adivice. I'll post back if I have any problems
but that looks straight forward enough.

Thanks again,

Spencer

On 4/25/05, Michael Kay <mike(_at_)saxonica(_dot_)com> wrote:
Before you start rendering this data, you should group it hierarchically so
that clauses are nested within sections and sections are nested within
parts. You can do this conveniently using group-starting-with:

<xsl:template match="act">
<xsl:for-each-group select="*" group-starting-with="part">
<part>
  <xsl:for-each-group select="current-group()[not(self::part)]"
group-starting-with="section">
    <section>
      <xsl:copy-of select="current-group()[not(self::section)]"/>
    </section>
  </xsl:for-each-group>
</part>
</xsl:for-each-group>
</xsl:template>

Michael Kay
http://www.saxonica.com/

-----Original Message-----
From: Spencer Tickner [mailto:spencertickner(_at_)gmail(_dot_)com]
Sent: 25 April 2005 21:39
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: Re: [xsl] First attempt at xsl:result-document

Hi Michael, thank you very much for the reply.

I had a feeling this was the case before, thank you for re-affirming
my supicions. So do you have any advice for pulling this information
out? or is it impossible? I appreciate any thoughts you have on this
matter (unless they have to do with re-writing my entire xml base :)).

Thank you

Spencer

On 4/25/05, Michael Kay <mike(_at_)saxonica(_dot_)com> wrote:
Thanks once again for the reply. I've retested my
application and do
not think the URI is the problem. As an example

.
.
.
<xsl:for-each select="part">
<xsl:variable name="filename" select="concat('file:///',
position(), '.htm'"/>
<xsl:result-document href={$filename}" format="html">
<html>
<body>

<!-- Test -->
<xsl:value-of="/act/title"/>
<!--End of Test -->

<xsl:apply-templates mode="content"/>
</body>
</html>
</xsl:result-document>
</xsl:for-each>
</xsl:template>

Now let's say I have 4 parts in an xml document. I do get
5 files in
the end (1 table of contents and 4 parts) and each file
is named as
expected and each file picks up the title. However none
of the files
pick up any content from the <xsl:apply-templates
mode="content"/>.


Your example XML was:

<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>

In this example, the only child of the <part> element is a
single text node.
I would expect this text to be output as a result of the
<xsl:apply-templates mode="content"/> call. I would not
expect the section
and clause elements to be output, because they are not
children of the
<part>.

Michael Kay
http://www.saxonica.com/



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>