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

RE : Still Testing!

Subject: RE : Still Testing!
From: "Adam J Knight" <adam@xxxxxxxxxxxxxxxxx>
Date: Sun, 13 Feb 2005 21:04:02 +1000
adam test
If the current node id 8 and c_node is 7 then that test will be true.
As you don't say what you did or in what way you think it didn't work,
hard to give any advice.  David

Reply:

This is my xsl:template I am using.
It doesn't appear to work, in that the second condition doesn't cause the
display of the appropriate value.

<xsl:template match="tree_node">

	<xsl:if test="parent::tree or parent::tree_node[@id=$c_node]">
          <xsl:value-of select="@value"/>
      </xsl:if>

  </xsl:template>


<?xml version="1.0"?>
<tree>
  <tree_node id="7" value="Test">
    <tree_node id="8" value="Test Sub"/>
      <tree_node id="9" value="Test Sub One">
      <tree_node id="10" value="Test Sub Two">
        <tree_node id= 11  value= Test Sub Three />
      </tree_node>
    </tree_node>
  </tree_node>
</tree>

My understanding of the above template is that is will match all tree_node
elements, regardless of node depth. However, when the context node is
tree_node with id 8, the node that meets the second condition ($c_node=7)
the appropriate value is not outputted.

What am I missing??

Cheers,
Adam
 
NB: "Pray as if everything depended upon God and work as if everything
depended upon man."

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.