This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
xsl parent
- To: <xsl-list at mulberrytech dot com>
- Subject: xsl parent
- From: "Paul Beer" <paul dot beer at backsoft dot com>
- Date: Tue, 14 Mar 2000 18:50:44 -0500
- Reply-To: xsl-list at mulberrytech dot com
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