Re: [xml] Well formed ?



OK!
Actually, I'd like to know also if a file is not well-formed. I use xmlParseFile that returns NULL in case of problem. But this does not necessarily mean that the document is not well-formed. I suppose that xmlParseFile returns also NULL when I/O problems and, perhaps, other problems. If there is an I/O problem or other, I'd like to report the problem to the user, but if the file is not well formed, another actions must be taken. How can I do that ?
What about xmlParseDoc ? Tha documentation says that it returns a resulting tree. And What happens if the in-memory document is not well formed ?
Thanks for your help,
 
Christophe

 


On Tue, Aug 13, 2002 at 09:37:43AM +0200, chrisbee xml swing be wrote:
> Is there a function in libxml that returns whether a file or buffer content is well-formed ?

Parse it! If it parses without error, it's well formed, and there isn't any
simpler way that doing the parse to check for well-formedness.

Daniel

--
Daniel Veillard | Red Hat Network https://rhn.redhat.com/
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]