Leo Wörteler lw@basex.org wrote:
Dear Fabrice,
Am 15.07.2011 11:18, schrieb Fabrice Etanchaud:
I would like to add something like <?xml-stylesheet type="text/xsl" href="linktomystylesheet.xsl"?>between the xml declaration and the generated xml. I did not find any xml-stylesheet option for serialization.
as BaseX doesn't have to understand what xml-stylesheet does, it treats it like any other processing instruction [1]. To add one to your output document, just insert it as the first node:
declare option output:omit-xml-declaration "no";
let $generated-xml := <foo><bar/></foo> return document {
<?xml-stylesheet type="text/xsl" href="linktomystylesheet.xsl"?>,
text { '
' }, $generated-xml }
This produces:
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="linktomystylesheet.xsl"?>
<foo> <bar/> </foo>
Note that 
 is the entity for the ASCII newline character, I inserted it only for readability.
BaseX is just wonderful.
Thank you!
Leo __________ [1] http://en.wikipedia.org/wiki/Processing_instruction _______________________________________________ BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk