xsl-list
[Top] [All Lists]

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

2008-12-19 10:00:38
The result of applying Canonical XML to the resulting XPath node-set is the
following (except for line wrapping to fit this document):

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

Note that the n0 namespace has been included by Canonical XML because it
includes namespace context. This change which would break a signature over
elem1 based on the first version.

I'm trying to find an *XPath 1.0* (not XSLT) expression that will only
include visibly utilized namespace nodes on an element. That is, applied to
the above document I want to select

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

I'm beginning to think that isn't possible. Any ideas?


Interestingly enough, I'm suffering with the problem that is your
desired result, which I've raised on the eXist list this morning...

Fwiw, if you run this in eXist:

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>





-- 
Andrew Welch
http://andrewjwelch.com
Kernow: http://kernowforsaxon.sf.net/

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