I feel like I've seen this on the list already, but I can't seem to find the discussion.

The document '/blah.xml' contains no namespaces.

xquery version "1.0-ml";
let $doc := doc('/blah.xml')
return
  <a xmlns="http://myns";>
    <b>{ $doc/one/two/text() }</b>
  </a>

This query statement will result in <a xmlns="http://some/namespace";><b/></a>, because the xpath is looking for one and two in the "http://myns"; namespace.

I could (have) declare(d) an empty namespace (pre-ML4, I think), something like...

declare namespace none = ""

...and do $doc/none:one/none:two/text(). However, I believe since ML4, I'd get an "XDMP-UNBPRFX: (err:XPST0081) Prefix none has no namespace binding" error.

How can I get at the no-namespace elements of a document, within an element with a default namespace? Is $doc/*:one/*:two/text() the Right Way (tm)?

Cheers,

Eric
_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general

Reply via email to