Alright... Here's what I'm trying to do.
<Doc>
<Head>
<Column>First Column</Column>
<Column>Second Column</Column>
<Column Numeric="true">Third Column</Column>
</Head>
<Body>
<Item>
<Field1>first</Field1>
<Field2>second</Field2>
<Field3>3</Field2>
</Item>
</Body>
</Doc>
I'm using XSLT to transform this XML into an HTML table... I'm trying to keep everything generic as possible (ie using XPath instead of specific node names) so that I can reuse the XSL.
What I need to do is recall the "Numeric" attribute from a for-each lower in the XML. I'm looping through each field in a given "Item" and if the "Column" node that corresponds with that field has 'true' for the Numeric attribute, then I want to right align that field in the table.
I'm having something like
<xsl:if test="/*/*[1]/*[position()]/@Numeric = true()"> ...
Anyways, I'm not getting an error on the line or anything, it's just not coming up with the right thing. It's ALWAYS true.... so, to test it, I did a few xsl:value-of's to see what things were coming up as: the value-of /*/*[1]/*[position()] is ALWAYS the first item... even though the value-of position() is changing right, in that context, it's always 1. What am I doing wrong?
Thanks...
Gideon
<Doc>
<Head>
<Column>First Column</Column>
<Column>Second Column</Column>
<Column Numeric="true">Third Column</Column>
</Head>
<Body>
<Item>
<Field1>first</Field1>
<Field2>second</Field2>
<Field3>3</Field2>
</Item>
</Body>
</Doc>
I'm using XSLT to transform this XML into an HTML table... I'm trying to keep everything generic as possible (ie using XPath instead of specific node names) so that I can reuse the XSL.
What I need to do is recall the "Numeric" attribute from a for-each lower in the XML. I'm looping through each field in a given "Item" and if the "Column" node that corresponds with that field has 'true' for the Numeric attribute, then I want to right align that field in the table.
I'm having something like
<xsl:if test="/*/*[1]/*[position()]/@Numeric = true()"> ...
Anyways, I'm not getting an error on the line or anything, it's just not coming up with the right thing. It's ALWAYS true.... so, to test it, I did a few xsl:value-of's to see what things were coming up as: the value-of /*/*[1]/*[position()] is ALWAYS the first item... even though the value-of position() is changing right, in that context, it's always 1. What am I doing wrong?
Thanks...
Gideon