Re: [xml] Parsing by chunk but unknown terminate



On Sun, Feb 10, 2008 at 01:27:24PM +0100, qk wrote:
Hi,
I need parsing chunk of memories. But I don't know which chunk is 
terminate (so it can be first or nineth). Is any posibility to after 
each chunk try if it is validate and if so then make dom tree?

  Basically no. http://www.w3.org/TR/REC-xml/#NT-document

    [1]         document           ::=           prolog  element  Misc*

see that terminating Misc* ? That mean the parser can't guess if there is
more content pertaining to this document even after the root element has
been closed.
If you are put in a situation where the XML input layer can't tell you
when the document is terminated, then that means that input layer has
been designed by people you didn't try to read the first page of the
XML specification. It's not suitable for XML transport, either by design
or by negligence, too bad... Try to put markers in the flow to indicate
where the document ends and detect it at the lower level.

Daniel

-- 
Red Hat Virtualization group http://redhat.com/virtualization/
Daniel Veillard      | virtualization library  http://libvirt.org/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine  http://rpmfind.net/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]