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]

Complex Path Checking


Hello,

I have an XML structure like this:

<root>
 <node1>
  <node2>some content</node2>
 </node1>
 <node1>
  <node2>other content</node2>
 </node1>
.
.
.
</root>

This needs to stay as is. My problem is, I want to check the content 
of the first <node2> (with "some content") before I decide if I 
display the content of the other <node2> (with "other content"). I
need to do this through the whole large document.

Now, I'm not exactly experienced when it comes to XPath. I tried the 
following, but as I already expected ;) , it didn't work.

 <xsl:template match="//node2">

 <xsl:if 
test="contains(ancestor::following-sibling::child::node(),'X')">

<perform some actions with the "other content"-node2>
</perform>

</xsl:if>

</xsl:template>


Pleeeeeease help me, this is all what's keeping me from finishing my 
current small project ;)

Thanks,

Heiner


 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]