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

RE: xsl parent [actually re preceding-sibling]

Subject: RE: xsl parent [actually re preceding-sibling]
From: Kay Michael <Michael.Kay@xxxxxxx>
Date: Wed, 15 Mar 2000 10:39:55 -0000
xsl parent
> here is my code:
> 
>      <xsl:variable name="POITEM">10</xsl:variable>

Not an error, but I'd suggest using <xsl:variable name="POITEM"
select="10"/> so it's a number rather than a result tree fragment.

>      <xsl:attribute name="quantity">
>  		<xsl:for-each select="/Table[@Name =
> 'PO_ITEM_ACCOUNT_ASSIGNMENT']/Record/Parameter">

A very strange select statement, you are asking for Table elements that are
immediate children of the root and that also satisfy some predicate; since a
well-formed document has only one child element of the root this will return
zero or one Table elements. OK if that's what you really want.

> 		 <xsl:if test="./@Name = 'PO_ITEM'">

"./" at the start of a path expression is redundant.

> 		 <xsl:variable name="POITEMTEMP"><xsl:value-of 
> select="."/></xsl:variable>
> 			 <xsl:if test="$POITEMTEMP=$POITEM">

Don't know why you are using a variable here, what's wrong with
test=".=$POITEM"?

> 			    <xsl:value-of
> select="preceding-sibling::node()[./@Name='QUANTITY']"/>

Nothing wrong with this. The "./" is redundant but does no harm. But in your
example this selects nothing because the PO_ITEM parameter is the first, so
it has no preceding siblings.

> 			 </xsl:if>
> 		 </xsl:if>
> 		</xsl:for-each>
> 	 </xsl:attribute>
>

Mike Kay 


 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.