XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
RE: [xml-dev] Nested Documents (was: XML 2.0)

Having only looked at sections of parser code, I don’t know the answer to this.  What is it about a 1.0 parser that tells it to build the document node?  Is it simply the start of the root element?  To me, XML 1.0 has a single document node and a single root element (which is a child of the document node).  I’m not clear on why the spec would not need to change to allow multiple documents in a single file (or stream or whatever).

 

Using today’s parsers I can’t parse the following as a single stream/file/etc.

 

<person>

  <name>Matt Johnson</name>

</person>

<person>

  <name>Michael Kay</name>

</person>

 

I have to add the arbitrary <people> wrapper which I may not care about.

 

Using today’s parsers, I think this would be viewed as two root elements under a single document node which causes the parser to fail.  Not being clear on the details of a parser, it is not clear to me how it would know (using the existing spec) that each <person> should be attached to separate document nodes.  Perhaps your point is that the spec doesn’t care and it is an implementation issue?

 

Thanks.

 

Matt

 


From: Michael Kay [mailto:mike@saxonica.com]
Sent: Wednesday, February 27, 2008 4:44 PM
To: Johnson, Matthew C. (LNG-ALB); xml-dev@lists.xml.org
Subject: RE: [xml-dev] Nested Documents (was: XML 2.0)

 

 

In a world where XML allows multiple roots, I’m curious whether each root would potentially allow a different encoding?  Would multiple prologs be allowed?   

 

 

We're talking here about multiple elements underneath a single document node, not about multiple XML documents held in a single file. (Multiple documents in a single file requires no change to the specification, since the word "file" is not mentioned except by way of examples in the XML rec: a parser starts with a sequence of octets, and where it gets them from is outside the scope of the spec.) 

 

Michael Kay

http://www.saxonica.com/



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


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

Copyright 1993-2007 XML.org. This site is hosted by OASIS