xsl-list
[Top] [All Lists]

Re: [xsl] XPath and namespace nodes: a tough one

2008-12-19 10:07:42
Andrew Welch wrote:

let $foo :=   <n0:pdu xmlns:n0="http://a.example";>
     <n1:elem1 xmlns:n1="http://b.example";>
         content
     </n1:elem1>
  </n0:pdu>
return $foo/*

you get:

<n1:elem1 xmlns:n1="http://b.example";>
     content
</n1:elem1>

  Which is not really nice if you have something like:

    <n1:elem1 xmlns:n1="http://b.example"; value="n0:something">
       content
    </n1:elem1>

  BTW, Elliotte said:

The subdocument with elem1 as its apex node can be extracted from
this second case with an XPath expression such as:
 (//. | //@* | //namespace::*)[ancestor-or-self::n1:elem1]

  But this expression returns a node set with several nodes, all
descendant of n1:elem1, and not the element n1:elem1 (with its
descendant.)

  Unfortunately, this is not possible to discard a namespace in
XPath only.

  Regards,

-- 
Florent Georges
http://www.fgeorges.org/























      

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