[jdom-interest] Standalone attribute in <?xml PI

Jason Hunter jhunter at acm.org
Thu Mar 14 17:06:07 PST 2002


The last time we discussed what to do about standalone we punted and
decided to let people override printDeclaration().  I think the
complicating situation was that the standalone flag is partly an
attribute of the document and partly something to do with the outputter,
and we didn't like having it tied to either.  I'm not saying we can't
add it, but it's non-obvious how best to add it.

-jh-

Alex Rosen wrote:
> 
> The standalone attribute is not currently supported by XMLOutputter, but it
> could easily be added, and for completeness it seems like it should be.
> You'd have to allow it to be "yes" or "no" or absent altogether, so maybe
> setStandaloneValue(String) would be the simplest API.
> 
> It is tempting to make the XML declaration a PI, but I don't think it's the
> right thing to do. The spec defines it as not being a PI, and when parsing
> it's not passed along as a PI. If you added it to your document as a PI to
> control the XML delcaration, then the document that you read back in
> afterwards would be different from the one you emitted (because this special
> PI would no longer be there).
> 
> Alex
> 
> > -----Original Message-----
> > From: jdom-interest-admin at jdom.org
> > [mailto:jdom-interest-admin at jdom.org]On Behalf Of Christian Holmqvist,
> > IT, Posten
> > Sent: Friday, March 08, 2002 3:27 AM
> > To: Jdom-Interest (E-mail)
> > Subject: [jdom-interest] Standalone attribute in <?xml PI
> >
> >
> > Hi!
> >
> > I'm rather new to XML so bare with me if I don't have all the exactly
> > correct terms and expressions going on yet... *smile*
> >
> > How to I add the standalone attribute to the <?xml
> > ProcessInstruction (or
> > more exactly xml file first line) or how do I change it from
> > YES to NO and
> > the other way around?
> >
> > I have been looking throgh the archive and seen some discussions about
> > putting the control of this (together with encoding) in the
> > XMLOutPutter
> > thingy. The thing is that I can not see the different between this
> > ProcessIntruction and other PIs (oki, parsing and well form
> > ness is hard to
> > do without it...). Why not let <?xml be a odernary PI that
> > can be changed,
> > removed and added. If it is missed when trying to pass it to
> > a parser the
> > parser WILL complain with some form of error msg...
> >
> > Hmm oki, thank you for your time!
> >
> > /Christian
> > _______________________________________________
> > To control your jdom-interest membership:
> > http://lists.denveronline.net/mailman/options/jdom-interest/yo
> > uraddr at yourhost.com
> 
> _______________________________________________
> To control your jdom-interest membership:
> http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhost.com



More information about the jdom-interest mailing list