SV: [jdom-interest] Standalone attribute in <?xml PI
Jason Hunter
jhunter at acm.org
Fri Mar 15 12:49:04 PST 2002
The XML Spec makes it very clear <?xml?> is not a PI. So therefore we
don't treat it as a PI. Pretty cut and dry.
-jh-
"Christian Holmqvist, IT, Posten" wrote:
>
> Hi
>
> I have been searching the archive but found very little information about
> this topic (I think the information stoped with the discussion about adding
> a set/get standalone method) so if I ask questions that has been asked
> before, excuse me.
>
> I would prefer that the <?xml... row in a document is treated as a
> ProcessInstruction, isn't that the logical way to handle it?
> Just look at the information in it the tag: version refers to the XML
> version the document is created in, encoding also refers to how to handle
> the characters in the document and standalone refers to if validation of the
> document should be performed. So all the information is about how the
> document is processed i.e. process instruction *smile*
>
> The way to handle it would be very simular to the root element...
>
> /Christian Holmqvist
>
> > -----Ursprungligt meddelande-----
> > Från: Jason Hunter [mailto:jhunter at acm.org]
> > Skickat: den 15 mars 2002 02:06
> > Till: Alex Rosen
> > Kopia: 'Christian Holmqvist, IT, Posten'; 'Jdom-Interest (E-mail)'
> > Ämne: Re: [jdom-interest] Standalone attribute in <?xml PI
> >
> >
> > 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/yo
> uraddr at yourhost.com
More information about the jdom-interest
mailing list