Dear all at BaseX, how can one specify xml-stylesheet (for example in XQuery 3 prolog) ? 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.
BaseX is just wonderful.
best regards,
Fabrice ETANCHAUD Senior Software Engineer
edital
Berkenlaan 1
B-1831 Brussels, Belgium
+32 2 716 32 32 general
+32 2 716 32 20 fax
fetanchaud@edital.com
corsearch.com http://www.corsearch.com/ | edital.com http://www.edital.com/
Confidentiality Notice: This email and its attachments (if any) contain confidential information of the sender. The information is intended only for the use by the direct addressees of the original sender of this email. If you are not an intended recipient of the original sender (or responsible for delivering the message to such person), you are hereby notified that any review, disclosure, copying, distribution or the taking of any action in reliance of the contents of and attachments to this email is strictly prohibited. If you have received this email in error, please immediately notify the sender at the address shown herein and permanently delete any copies of this email (digital or paper) in your possession.
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@mailman.uni-konstanz.de