Re: [xsl] howto convert node set into 2D table

Subject: Re: [xsl] howto convert node set into 2D table
From: "Andrew Welch" <andrew.j.welch@xxxxxxxxx>
Date: Wed, 4 Jul 2007 10:45:49 +0100
On 7/4/07, Sam Carleton <scarleton@xxxxxxxxxxxxxxxx> wrote:
There is an attribute to determine if the element should be shown, the
data really looks like this:

<category>
 <images>
   <image name="a" display="true">1</image>
   <image name="b" display="true">2</image>
   <image name="c" display="true">3</image>
   <image name="d" display="true">4</image>
   <image name="e" display="false">5</image>
   <image name="f" display="true">6</image>
   <image name="g" display="false">7</image>
   <image name="h" display="true">8</image>
 </images>
</category>
[snip]
Ok, after writing this out, I think I know what I should be doing:

1: At the top <category> element, go off and create a new temporary
node set of either all the images/image[@display='true'] |
categories/category[@display='true']
2: Turn the <xsl:template match="images"> into a named template and
pass it the temporary node set from #1

Can't you just add [@display = 'true'] to each of your XPaths....?



Any thoughts on all my rambling?

It's always _much_ easier to work with sample inputs and required outputs than ramblings, and someone is more likely to reply to a concise question which takes at most a few minutes to read.

--
http://andrewjwelch.com

Current Thread