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
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
Sushant PrabhuSubject: interspering an xml declaration
Author: Sushant Prabhu
Date: 02 Jan 2007 10:54 PM
Hi All,

How can I acheive this. I am currently using xsl for xml to xml transformation. The new xml generated is forwarded to a method which carries out the xml parsing (confirms to DTD check).

In order to acheive that I need to interspere the DTD reference as XML declaration in the newly generated xml.

This is what I need to add in the start of every xml payload generated.
*********************************
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE destination SYSTEM "world.dtd" [
<!ENTITY euro "Euro">
]>
************************************

Here is the xsl which I use to render the xml & I need the above xml declaration included

--------------------------------------------------

<xsl:template match="arts">

<tag1>
blah blah
</tag1>

<tag2>
blah blah
</tag2>

</xsl:template>


<xsl:template match="article">

<tag11>
blah blah
</tag11>

<tag22>
blah blah
</tag22>

</xsl:template>
--------------------------------------------------

I tried to include a call template routine but was not of much help

--------------------------------------------------
<xsl:template name="wrapper" match="wrapper">

<xsl:param name="content"/>

<xsl:text>

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE destination SYSTEM "world.dtd" [
<!ENTITY euro "Euro">
]>


</xsl:text>
<xsl:copy-of select="$content"/>

</xsl:template>
--------------------------------------------------

But when I run this I get the following error

org.xml.sax.SAXParseException: XML declaration may only begin entities.


Do post your thoughts on the same


Regards,

Posttop
Minollo I.Subject: interspering an xml declaration
Author: Minollo I.
Date: 02 Jan 2007 11:02 PM
What Stylus Studio version, edition and build number are you running? (Help > About)

 
Topic Page 1 2 3 4 5 6 7 8 9 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.