xsl-list
[Top] [All Lists]

RE: Get specific elements

2003-04-28 02:52:07
Hi Johan,

Hello

I have an XML looking like

<AAA>
   <BBB>
      <CCC>
      </CCC>
   </BBB>
   <CCC>
   </CCC>
</AAA>

How can I specify to get the CCC with parent /AAA/BBB element 
separated from the
CCC with parent /AAA/. Meaning getting an element depending 
on all preceding 
parents. I reckon this could be done recursively. But Im 
stuck at the moment...

Depending on what you're trying to do:

- use different templates, one to match "BBB/CCC", the other to match
"AAA/CCC"
- actually test for the parent 
        <xsl:if test="parent::BBB">,
        <xsl:if test="../self::BBB">
        <xsl:if test="ancestor::*[1][local-name()='BBB']">

regards,
TomSW

 "They put us through the pain of learning to walk and talk, and when
we manage that, they tell us to be quiet and sit still."
Eric Chevillard - Préhistoires


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



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