XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
David JaramilloSubject: How to generate XML with processing instructions
Author: David Jaramillo
Date: 10 Feb 2006 04:12 AM
can anybody tell me how to output an xml file using xquery, which contains processing instructions?
for instance to include the prolog of the xml document like:
<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<!DOCTYPE mymodel SYSTEM "http://www.test.com/model.dtd">

Thanks!
David

Posttop
Minollo I.Subject: How to generate XML with processing instructions
Author: Minollo I.
Date: 10 Feb 2006 09:24 AM
XQuery the language won't allow you to create specific <?xml PIs or DOCTYPE declarations; but the serializer may.

The Stylus Studio built-in processor doesn't support those serialization properties; Saxon should:

declare namespace saxon="http://saxon.sf.net/";
declare option saxon:output "encoding=ISO-8859-1";
declare option saxon:output "standalone='no'";
declare option saxon:output "doctype-system=http://www.test.com/model.dtd";

You won't see PI or DOCTYPE when run in XQuery editor, but if you generate Java code (XQuery > Generate Java Code) and run it, you will see the DOCTYPE is generated; you probably need to serialize the result in a way different from what the generated Java code is doing to also see the XML PI.

Hope this helps,
Minollo

 
Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.