xsl-list
[Top] [All Lists]

RE: Get specific elements

2003-04-28 03:34:15
 
Hello again

Thanks for the answer. I was think if there was a way of using ./ancestor::*

Something like this

<xsl:variable name="path" select="./ancestor::*"/>
<xsl:variable name="elements" select="document($doc)//*"/> 

and then find THE element with the same ancestors.

<xsl:variable name="element" ...

Best regards
Johan Thoren


-----Original Message-----
From: Jarno(_dot_)Elovirta(_at_)nokia(_dot_)com 
[mailto:Jarno(_dot_)Elovirta(_at_)nokia(_dot_)com]
Sent: den 28 april 2003 11:38
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: RE: [xsl] Get specific elements


Hi,

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...

"/AAA/BBB/CCC" or "//CCC[parent::BBB]" or "//CCC[not(parent::AAA)]" or write 
more specific template match patterns i.e. "AAA/BBB/CCC" and "AAA/CCC" etc. 
Which is the best depends on what your stylesheet looks like, that is where you 
want to "specify to get the CCC".

Cheers,

Jarno - Hocico: Spit as an offence(suicide commando remix)


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

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



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