xsl-list
[Top] [All Lists]

Re: [xsl] some XPath please ?

2010-06-23 02:29:01
Hi Fabien,

Try //tag2[not(parent::tag1)]

Sheila



On 23/06/10 08:03, Fabien Tillier wrote:
Please, Ignore the 3D, it is a character converted by outlook when switching to 
text only...


-----Message d'origine-----
De : Fabien Tillier [mailto:f(_dot_)tillier(_at_)cerep(_dot_)fr]
Envoyé : mercredi 23 juin 2010 08:51
À : xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Objet : [xsl] some XPath please ?

Hi List.
Suppose I get a (simple) XML
<xml>
<tag1>
  <tag2>
   <tag3/>
   <tag3/>
  </tag2>
  <tag2>
   <tag3/>
   <tag3/>
   <tag3/>
  </tag2>
</tag1>
<tag2>
  <tag3/>
  <tag3/>
</tag2>
<tag2>
  <tag3/>
  <tag3/>
  <tag3/>
</tag2>
</xml>

What if I want to select all tag2 elements that did not have a tag1
above ?
I have tried

"//tag2[parent::node!=3D'tag1']/*"

But it gets all ...

And

"//tag2[parent::node!=3Dtag1]/*"

Gets nothing

(and I would prefer not using the higher level nodes like /xml/tag2
against /xml/tag1/tag2)

Thanks in advance !
Regards,
Fabien


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


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




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