OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: Appending to an XML document

[ Lists Home | Date Index | Thread Index ]
  • From: David Megginson <david@megginson.com>
  • To: xml-dev@ic.ac.uk
  • Date: 10 Dec 1999 14:19:56 -0500

"Clark C. Evans" <clark.evans@manhattanproject.com> writes:

> On Fri, 10 Dec 1999, Don Park wrote:

> > IMHO, this is a parser implementation problem.  I do not know of a
> > single XML parser that expects more than one XML document in a
> > file or a stream input.
> 
> I tend to agree here.  If a DOM parser encounters more than one root
> element, it could easily create a root element, say by grabbing the
> name of the file.  If a SAX parser encounters more than one root
> element, it should just proceed by ending the first 'root' element,
> and then starting the next one.

No, these would both be non-conformant -- the XML spec defines a
document as the main production, and a parser that encounters a second 
root element in what is being given to it as a document simply has to
stop processing, except for error reporting.

You have to distinguish the document boundaries in a single stream
before you pass it on to the parser.  For example, you could use ^L as
the document separator, and start a new parse each time you see it.


All the best,


DAvid

-- 
David Megginson                 david@megginson.com
           http://www.megginson.com/

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1
To unsubscribe, mailto:majordomo@ic.ac.uk the following message;
unsubscribe xml-dev
To subscribe to the digests, mailto:majordomo@ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@ic.ac.uk)






 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS