Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


[xsl] Ordering my HTML output

From: "Aaron McGrath" <aaronmcgrath@----------->
To:
Date: 3/1/2005 12:09:00 PM
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


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent