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

Ordering my HTML output

Subject: Ordering my HTML output
From: "Aaron McGrath" <aaronmcgrath@xxxxxxxxxxx>
Date: Tue, 01 Mar 2005 12:08:08 +0000
aaron mcgrath
Hi All!

I have looked through the list and don't seem to find anything that answers my specific question, but if there is... I apologise!

I have an xml file similar to this:
<abs:body>
  <abs:heading class='100' string='test'>
     <abs:heading class='200' string='tester'></abs:heading>
        <abs:heading class='300' string='sometext'></abs:heading>
        <abs:heading class='300' string='somemoretext'></abs:heading>
     <abs:heading class='200' string='testing'></abs:heading>
  </abs:heading>
</abs:body>

This is the output I would like:

class = 200 string='tester'
class = 200 string='testing'
class = 300 string='sometext'
class = 300 string='somemoretext'

What I am trying to achieve is to throw out all instances of a specific class, so for example I might do a <xsl:apply-templates select="@class=200">, then I might have a specific template match for that class somewhere.
But then, which is the bit I am struggling with is being able to then list all instances of another class. Now if I then make a call to something like <xsl:apply-templates select="@class=300"> again with a template match somewhere in my xsl, nothing seems to happen.


I think the problem is that the class=300 elements in the xml above could be great great grand children of a class=200 element.

Sample xsl (forgive the errors in syntax, I hope it is clear enough though):

<xsl:apply-templates select="@class=200"/>
<xsl:apply-templates select="@class=300"/>

<xsl:template match="@class=200">
  Output something here
</xsl:template>

<xsl:template match="@class=300">
  Output something else here
</xsl:template>

Is it a case of having to do a <xsl:apply-templates/> in the first template match so the rest of the document is parsed in memory?

I hope I have explained my question clearly...?

Thanks for any help or advice!

AM

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.