xsl-list
[Top] [All Lists]

RE : Still Testing!

2005-02-13 04:04:02

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[(_at_)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."



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>