|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] xsl parent
i am using xsl:if in a for loop to filter out items with a certain item no.
this value is 10.
i want to display a sibling of the field in the filter. How do I access a
sibling value from within the
if statement that qualifies I am in a certain node ?
i am using <xsl:value-of
select="preceding-sibling::node()[./@Name='QUANTITY']"/>
and it doesnt work. Can someone correct my syntax or let me know an
alternate way of getting
just the value of QUANTITY for the record with PO_ITEM = 10?
thanks,
paul
here is my code:
<xsl:variable name="POITEM">10</xsl:variable>
<xsl:attribute name="quantity">
<xsl:for-each select="/Table[@Name =
'PO_ITEM_ACCOUNT_ASSIGNMENT']/Record/Parameter">
<xsl:if test="./@Name = 'PO_ITEM'">
<xsl:variable name="POITEMTEMP"><xsl:value-of select="."/></xsl:variable>
<xsl:if test="$POITEMTEMP=$POITEM">
<xsl:value-of
select="preceding-sibling::node()[./@Name='QUANTITY']"/>
</xsl:if>
</xsl:if>
</xsl:for-each>
</xsl:attribute>
here is the xml:
<Table Name="PO_ITEM_ACCOUNT_ASSIGNMENT">
<Record>
<Parameter Name="PO_ITEM" ><![CDATA[10]]></Parameter>
<Parameter Name="SERIAL_NO"><![CDATA[0]]></Parameter>
<Parameter Name="QUANTITY"><![CDATA[1.000]]></Parameter>
<Parameter Name="DISTR_PERC"><![CDATA[0]]></Parameter>
</Record>
</Table>
<Table Name="PO_ITEM_ACCOUNT_ASSIGNMENT">
<Record>
<Parameter Name="PO_ITEM" ><![CDATA[10]]></Parameter>
<Parameter Name="SERIAL_NO"><![CDATA[0]]></Parameter>
<Parameter Name="QUANTITY"><![CDATA[1.000]]></Parameter>
<Parameter Name="DISTR_PERC"><![CDATA[0]]></Parameter>
</Record>
<Record>
<Parameter Name="PO_ITEM" ><![CDATA[20]]></Parameter>
<Parameter Name="SERIAL_NO"><![CDATA[0]]></Parameter>
<Parameter Name="QUANTITY"><![CDATA[1.000]]></Parameter>
<Parameter Name="DISTR_PERC"><![CDATA[0]]></Parameter>
</Record>
</Table>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








