>That is not true. The definition of document in the XML 1.1 spec is:
>       (  prolog  element  Misc*  )

Hmmm. You're right; my error. That's true even in 1.0.


Tim Bray, in his Annotated XML Specification, said:

"The fact that you're allowed some trailing junk after the root element, I 
decided (but unfortunately too late) is a real design error in XML. If I'm 
writing a network client, I'm probably going to close the link as soon as 
a I see the root element end-tag, and not depend on the other end closing 
it down properly.
"Furthermore, if I want to send a succession of XML documents over a 
network link, if I find a processing instruction after a root element, is 
it a trailer on the previous document, or part of the prolog of the next?"

I can quibble with those -- the spec says you _can't_ reliably do the 
active shut-down nor concatenate multiple XML documents into a stream 
without running into the Misc* problem, so this may be a case of "if it 
hurts when you do that, don't do that." But I do think Best Practice is 
probably to avoid relying on PIs after the document unless you have 
complete control of the code on both ends of the wire.

Having said all that... I agree that it sounds like Xerces should always 
be delivering this late PI to the application. Can we come up with small 
testcase that demonstrates a failure to do so?


______________________________________
"... Three things see no end: A loop with exit code done wrong,
A semaphore untested, And the change that comes along. ..."
  -- "Threes" Rev 1.1 - Duane Elms / Leslie Fish (
http://www.ovff.org/pegasus/songs/threes-rev-11.html)

Reply via email to