Attributes for the root element


I’m new to QuiP and I can’t really figure out why my queries work when I have no attributes for the root element and don’t work when I do have some attributes.

For instance, a query on

works just fine, while a query on

does not generate any results.

Is it an unlisted limitation of the program?


Specifying xmlns=“some.uri” on the outermost element of your XML document changes the names of all the elements in the document. The name of an element has two parts, the namespace URI and the local name. By adding a default namespace declaration, you have changed the name of the element (for example) from (namespace=null, localname=“Director”) to (namespace=“some.uri”, localname=“Director”).

In XQuery or XPath, if you want to match on a name in a non-null namespace, you must include a namespace prefix. You need to write the name as dd:Director and to include a namespace declaration that associates the prefix “dd” with the URI “some.uri”.

XQuery does have a way of declaring the default namespace for unprefixed element names appearing in path expressions, but as far as I know it’s not implemented in QuiP at this stage.

Michael Kay

Thank you for the reply. It does make a great deal of sense. Thanks.