[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

xsl parent

Subject: xsl parent
From: "Paul Beer" <paul.beer@xxxxxxxxxxxx>
Date: Tue, 14 Mar 2000 18:50:44 -0500
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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.