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

Re: XSL problem

Subject: Re: XSL problem
From: David Carlisle <davidc@xxxxxxxxx>
Date: Mon, 2 Aug 1999 17:53:30 +0100 (BST)
peridocal
]  I have an structure that looks like the following:

] <hr><p><b> Periodical Subject </b></p></hr>
] <i> Peridocal Subject Desc <i>

hr shouldn't have content, and i should close, so assuming that
is
<hr/><p><b> Periodical Subject </b></p>
<i> Peridocal Subject Desc </i>

and you wrap a list of such things up in a <doc> element
then probably this is what you want:

It says for every table inside the doc element, process every row except
the first into a periodical list.

then the second template says what to do with a row.

David



<xsl:stylesheet 
  xmlns:xsl="http://www.w3.org/XSL/Transform/1.0"
  indent-result="yes">


<xsl:template match="doc">
<periodical-list>
  <xsl:apply-templates select="table/tr[position() &gt; 1]"/>
</periodical-list>
</xsl:template>

<xsl:template match="tr">
  <periodical>
    <subject><xsl:apply-templates select=
         "../preceding-sibling::p/b[1]"/></subject>
    <desc><xsl:apply-templates select=
         "../preceding-sibling::i[1]"/></desc>
    <title><xsl:apply-templates select=
         "td[1]"/></title>
    <author><xsl:apply-templates select=
         "td[2]"/></author>
    <length><xsl:apply-templates select=
         "td[3]"/></length>
  </periodical>
</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.