[jdom-interest] Question about "standalone" tag... [eg]

Joseph Bowbeer jozart at csi.com
Fri Apr 6 12:38:38 PDT 2001


jh writes:

> At the moment I'm thinking of putting both [encoding & standalone]
> in Document to better match Infoset.

Background: The standalone attribute is an optimization hint for the parser
(right?), indicating that the document doesn't depend on declarations in
external entities, and if there is no external DTD, then standalone is
assumed to be "yes".

I'd expected that the standalone attribute of the xml declaration would be a
property of the outputter, but I hadn't thought about it too much.

Even if a standalone property is added to the document, I think the
outputter should be allowed to override.  Otherwise, a client may not be
able to output a document created by someone else without first modifying
the document (eg, without first clearing the standalone property).


----- original message -----
From: Jason Hunter jhunter at collab.net
Date: Fri, 06 Apr 2001 10:18:04 -0700

Jason Hunter wrote:
>
> You'll see in the TODO.txt file an entry to figure out the best way to
> support this.  It seems straightforward to have a doc.setStandalone()
> and doc.getStandalone() pair of methods that the XMLOutputter can use on
> output.  Anyone have another idea, like maybe to try to be smarter about
> it, performing some checking that what they set to be standalone truly
> is standalone?
>
> One problem here is that SAX doesn't tell us the standalone flag value,
> so round tripping won't be 100%.
>
> -jh-

More thoughts on this issue:

For the encoding we've explicitly left that out of the Document and put
it as a flag to the XMLOutputter.  Maybe standalone should be handled
similarly?  Or maybe encoding and standalone should be aspects of the
Document.  I'm curious to hear arguments either way.  At the moment I'm
thinking of putting both in Document to better match Infoset.

-jh-




More information about the jdom-interest mailing list