[xquery-talk] Omit namespace attributes in output file

xquery at docbook-autor.de xquery at docbook-autor.de
Wed Apr 19 03:10:51 PDT 2017


 Hi,

> XQuery output has to be well-formed (and namespace-well-formed) XML,
> so you can't output an element name like <ac:emoticon> unless the
> "ac" prefix is declared and bound to a namespace URI. Why would you
> want to? Does Confluence really use non-namespace-aware XML?

my xml output file will be some Confluence wiki page saved as file on
the server so Confluence will load it on its next start-up.

Inside Clonfluence the namespace "ac" surely will be well-formed but
that is part of the higher-level "frame" where my xml file is loaded into.

BTW: The Confluence Storage Format for wiki pages uses all its
namespaces without namespace declaration inside the respective wiki page
itself. That seems to be part of the Confluence framework.

It is correct to demand the declaration of namespaces. I do not question
that. But with

declare option saxon:output "omit-xml-declaration=yes";

I can omit the xml declaration at the beginning of the xml output file.
I need some parameter/option to omit every namespace declaration.

Kind of:

declare option saxon:output "omit-all-ns-declaration=yes";

So I declare the following namespace as I do it now:

declare namespace ac="https://www.atlassian.com/schema/confluence/6/ac";

If not there will be an error message due to a missing namespace
declaration.

But the option above would leave the Confluence namespaced tags in my
output file as they are:

<ac:emoticon ac:name="warning"/>

Is there a possibility to achieve this with XQuery or Saxon?

 Best regards from Germany
  Michael


More information about the talk mailing list