Oxygen XML Editor
 
[XML-DEV Mailing List Archive Home] [By Thread] [By Date]

RE: [xml-dev] Nested Documents (was: XML 2.0)


  • From: "Johnson, Matthew C. (LNG-ALB)" <Matthew.C.Johnson@...>
  • To: "Michael Kay" <mike@...>, <xml-dev@...>
  • Date: Wed, 27 Feb 2008 21:33:08 -0500

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@...]
Sent: Wednesday, February 27, 2008 4:44 PM
To: Johnson, Matthew C. (LNG-ALB); xml-dev@...
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]
 
© 2002-2008 SyncRO Soft Ltd. All rights reserved. | Sitemap | Privacy Policy
This website was created & generated with <oXygen/> XML Editor
Keywords
xml