2

I am using BaseX 8.2.3 and need to query XML-documents with a default namespace. I know you have to specify the namespace context in this case. How do I do this in the BaseX GUI (I type my query in the "Find" field).

BTW I am also aware of the clark notation. However, my documents are fairly complex (and large) and i am looking for a (far more) compact syntax.

1 Answer 1

3

According to the BaseX wiki, the input bar has an XQuery mode as an alternative to the Find mode. So you can use XQuery to declare namespace prefixes and then use them in your XPath expressions. E.g.

declare namespace xh="http://www.w3.org/1999/xhtml";
//xh:p

Disclaimer: I haven't tested this with BaseX. It's just the result of online research. If it gives an error message, let me know what it says and maybe I can help.

Sign up to request clarification or add additional context in comments.

1 Comment

Good tip, works via XQuery button only! The whole query must be a one-liner. Minor disadvantage is that code completion does not work anymore.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.