[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Adding standalone="yes" to XML document


xml standalone yes
> Uche Ogbuji wrote:
> >>I am on the process of creating an XML document using JDOM API's for which 
> >>need to add standalone="yes". How can this be done ?
> > 
> > I'm not familiar with JDOM, but I don't know of any XML "API" that allows such 
> > fine control over the XML declaration.  Your best bet is probably a text 
> > processing step after serialization from DOM that changes the declaration 
> > according to your needs.  Since you'll probably have firm control over the 
> > documents you're producing, you might be able to control the trickier aspects 
> > of this.
> 
> PerlSAX2 makes that information part of the start_document() call, and SAX 
> writers should honour it. I suppose you could get Java SAX writers to honour the 
> is-standalone property?

Yes.  SAX2's LexicalHandler includes a "standalone" flag, so if one uses SAX 
as an *output* format you should have control over that declaration.  My 
mistake (I wasn't thinking broadly enough, even though I've used SAX for 
output a air bit before).

So I guess the solution might indeed be for the OP to switch to a Java SAX 
writer.  Might be more efficient, too.


-- 
Uche Ogbuji                                    Fourthought, Inc.
http://uche.ogbuji.net    http://4Suite.org    http://fourthought.com
Introducing Anobind - http://www.xml.com/pub/a/2003/08/13/py-xml.html
XML Topic Maps by the book - http://www-106.ibm.com/developerworks/xml/library/
x-think19.html
Charming Jython - http://www-106.ibm.com/developerworks/java/library/j-jython.h
tml
Python, Web services, and XSLT - http://www-106.ibm.com/developerworks/xml/libr
ary/ws-pyth13/
Perspective on XML: What is this 'agility'? - http://www.adtmag.com/article.asp
?id=8004



PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

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