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

From
Philippe Poulard <>
To
"Johnson, Matthew C. (LNG-ALB)" <>
Date
2008-02-29T09:16:36Z
ID
<>
Thread
Re: [xml-dev] Nested Documents (was: XML 2.0)
Hi,

Johnson, Matthew C. (LNG-ALB) a écrit :
> 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>

Several years ago I was using a third-party tool that was feeding my 
application with (sometimes) mutli-rooted documents (finally, it's 
almost the same issue than Michael Kay with its log files)

I introduced an option for addressing it in RefleX : you can ask for the 
"lax" or "strict" mode (the latter is naturally the default).

With mode="lax", XML fragments and well-formed XML documents will be 
parsed sucessfully ; this include fragments that doesn't contain a root 
element at all : you can also have only text or even text around root 
elements. Would it be also a new feature in XML 2.0 ?

It works for DOM and SAX.

In this example :
http://reflex.gforge.inria.fr/tips.html#parsingFragments
several documents are parsed and each fragment are merged in a new 
well-formed XML document.
Note : the target well-formed document can be a SAX document even if you 
parsed the fragments à la DOM : the engine will "cast" them automatically.

-- 
Cordialement,

               ///
              (. .)
  --------ooO--(_)--Ooo--------
|      Philippe Poulard       |
  -----------------------------
  http://reflex.gforge.inria.fr/
        Have the RefleX !