View Single Post
  #2 (permalink)  
Old August 14th, 2010, 06:21 AM
mhkay's Avatar
mhkay mhkay is offline
Wrox Author
Points: 18,481, Level: 59
Points: 18,481, Level: 59 Points: 18,481, Level: 59 Points: 18,481, Level: 59
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 4,960
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Sure, XSLT is very good at this sort of job. You just need three rules:

Code:
<xsl:template match="box[numberofball]">
  <notemptybox><xsl:value-of select="@id"/></notemptybox>
</xsl:template>

<xsl:template match="box">
  <emptybox><xsl:value-of select="@id"/></emptybox>
</xsl:template>

<xsl:template match="listbox">
  <categorybox><xsl:apply-templates/></categorybox>
</xsl:template>
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference
Reply With Quote
The Following User Says Thank You to mhkay For This Useful Post:
metinhoclam (August 14th, 2010)