View Single Post
  #3 (permalink)  
Old May 24th, 2006, 06:12 AM
cristtiah cristtiah is offline
Authorized User
Join Date: May 2006
Location: , , .
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts

i have this code

<xsl:stylesheet version="1.0" xmlns:xsl="" xmlns:asp="remove">
    <xsl:output method="html" />
    <xsl:key name="b" match="Field/@label" use="." />
    <xsl:key name="c" match="Field/@value" use="." />

    <xsl:key name="x" match="Field/@label" use="generate-id((self::Field[@pos='top']|following-sibling::Field[@label='End'])[last()])"/>

    <xsl:template match="/">
        <xsl:apply-templates />
    <xsl:template match="Form/Pages/Page">
            <xsl:apply-templates select="Fields" />

    <xsl:template match="Fields">
            <xsl:for-each select="Field[@pos='top']">
                        <xsl:copy-of select="key('x',generate-id())"/>


and xml

<?xml version="1.0"?>
                <Field type="Separator" label="none" title="Accounts Setup" pos="top"/>
                <Field type="TextBox" label="one" value="- 1" />
                <Field type="TextBox" label="two" value="- 2" />
                <Field type="TextBox" label="three" value="- 3" />
                <Field type="End" label="End" />
                <Field type="Separator" label="none" title="Investment" pos="top" columns="2"/>
                <Field type="TextBox" label="four" value="- 4"/>
                <Field type="TextBox" label="five" value="- 5"/>
                <Field type="End" label="End" />

I need to get the nodes between the type=separator and type=End and put them in a table like this

<td>- 1</td>
<td>- 2</td>
<td>- 3</td>
<td>- 4</td>
<td>- 5</td>