You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by COFFMAN Steven <SC...@CBSINC.com> on 2000/05/25 19:48:34 UTC

Offtopic:XSLT

I'm stumped. Maybe someone on this list will have pity on me and help me
out. 

I want to create a table of contents out of an XML document, and then go on
to create the document out of the same node that were used to create the
Table of Contents. So this is really two sets of XSLT tranformations to
create one merged result file. I can't seem to trick XSLT into doing what I
want. Any ideas? 

<story>
  <section>
    <name>Chapter 1</name>
    <content>Once upon a time there was a...</content>
  </section>
  <section>
    <name>Chapter 2</name>
    <content>Later that very night, the evil stepsister...</content>
  </section>
</story>
-----------------------
Table of Contents
Chapter 1	page 2
Chapter 2	page 3

<page break>

Chapter 1
Once upon a time there was a ...

<page break>

Chapter 2
Later that very night, the evil stepsister...

<EOF>
----------------------------

RE: Offtopic:XSLT

Posted by Dave Pawson <da...@virgin.net>.

     I want to create a table of contents out of an XML document,
     and then go on
     to create the document out of the same node that were used to
     create the
     Table of Contents. So this is really two sets of XSLT tranformations to
     create one merged result file. I can't seem to trick XSLT into
     doing what I
     want. Any ideas?

     <story>
       <section>
         <name>Chapter 1</name>
         <content>Once upon a time there was a...</content>
       </section>
       <section>
         <name>Chapter 2</name>
         <content>Later that very night, the evil stepsister...</content>
       </section>
     </story>
     -----------------------
<xsl:template match="/">
<h2>     Table of Contents </h2>
<xsl:for-each select="section">
<h4>     <xsl:value-of select="name"/> </h4> page 2
</xsl:for-each>

       <br />
     <xsl:apply-templates/>
 </xsl:template>

<xsl:template match=" story">
etc

HTH DaveP     ----------------------------