Xquery - Output DocType
Posted: Wed Jul 16, 2014 2:17 am
Hi all,
I have an xquery file (.xql) that I use to generate an XML table via an xquery module (.xqm).
The module contains a function that generates a table similar to this:
I retrieve this table in the .xql file.
Now, I would like to add a doctype on top of that table, to look like this:
Note that I use xquery 3.0. I found that I should be able to output the doctype by declaring an option on top of the .xql file (right below 'xquery version "3.0";') like this:
I tried this both in the .xql and .xqm files, without success.
Hard-coding the doctype in the .xqm doesn't work either.
Does any of you have an idea for this?
Thanks in advance,
Jonathan
I have an xquery file (.xql) that I use to generate an XML table via an xquery module (.xqm).
The module contains a function that generates a table similar to this:
Code: Select all
<Doctype>
<Table>
<Row>
<Entry>
</Entry>
</Row>
</Table>
</Doctype>
Now, I would like to add a doctype on top of that table, to look like this:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Doctype PUBLIC "my-doctype-public" "my-doctype.dtd">
<Doctype>
...
</Doctype>
Code: Select all
declare namespace output = "http://www.w3.org/2010/xslt-xquery-serialization";
declare option output:method "xml";
declare option output:media-type "text/xml";
declare option output:omit-xml-declaration "no";
declare option output:indent "yes";
declare option output:doctype-public "my-doctype-public";
declare option output:doctype-system "my-doctype.dtd";
Hard-coding the doctype in the .xqm doesn't work either.
Does any of you have an idea for this?
Thanks in advance,
Jonathan