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

Re: Question about creating 2 output nodes from 1 input node

Subject: Re: Question about creating 2 output nodes from 1 input node
From: David Carlisle <davidc@xxxxxxxxx>
Date: Tue, 23 Nov 1999 18:34:25 GMT
input node

> I know what rules to write to output the first part of the output tree
> (the paragraphs and their titles), but I don't understand how I can add 
> the list of nodes that contains the information that are already used 
> to make the 1st part of the output tree.
> 

You can go over the input tree as often as you like.
Below I use apply-templates for the first, and for-each to go over
again. If the formating of the second pass were more complicated I would
probably have used apply-templates again but with a different mode.


The following assumes  you put <x> </x> around your example to make it a
well formed document, 


<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                version="1.0"
                >

<xsl:output method="xml" indent="yes" />

<xsl:template match="x">
<xsl:apply-templates/>
<list>
<xsl:for-each select="title">
  <p><a name="{@id}"/><xsl:value-of select="."/></p>
</xsl:for-each>
</list>
</xsl:template>

<xsl:template match="title">
  <a href="#{@id}"><xsl:value-of select="."/></a>
</xsl:template>


<xsl:template match="p">
  <p>
  <xsl:apply-templates/>
  </p>
</xsl:template>


</xsl:stylesheet>


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.