This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: get the value from a different child


When you call the following line:
 
<xsl:value-of select="BILLING_ATTRIBUTES[NAME=$myName]"/> 
 
you are asking for the value of the element "BILLING_ATTRIBUTES" which is a
child of the currently selected node.
 
1) There are no "BILLING_ATTRIBUTES" elements anywhere on the tree...
2) The current node is "ATTRIBUTE"
3) The "BILLING_ATTRIBUTE" element in your tree does not have any text()
nodes associated with it.
 
What you want is something like:
 
<xsl:value-of select="//BILLING_ATTRIBUTE[NAME=$myName]/VALUE/text()"/> 
 
or, to be more precise:
 
<xsl:value-of select="../BILLING_ATTRIBUTE[NAME=$myName]/VALUE/text()"/>   
        
(the first asking for a BILLING_ATTRIBUTE element anywhere on the tree, the
second specifically asking for a sibling of the current node).
 
By the way, if you are using anything other than IE5's XML parser, you can
use the shorthand:
 
<input type="text" name="{NAME}"
value="{="../BILLING_ATTRIBUTE[NAME=$myName]/VALUE}" />
 
instead of using <xsl:attribute>
 
Hope this helps,
 
Ben


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]