Re: [xml] Use of xmlValidate* functions in tree

On Sun, Apr 06, 2008 at 02:08:42PM -0400, Edward Z. Yang wrote:
Hash: SHA1

When manipulating libxml2's tree, when is it required to call the
xmlValidate*() functions? I did some testing, and it seems that libxml2
will happily create attributes or elements that do not conform to the
lexical space of Name, etc. When the tree is serialized the XML is
invalid, but libxml2 doesn't explode or anything like that.

Also, I'm curious to know where lies the burden for checking the
validity of these things. Is the client code expected to check? If so,


is there a "safe" wrapper that will automatically do the checks? I

  Hum, no ... just call xmlValidateName before the normal tree API call.


Red Hat Virtualization group
Daniel Veillard      | virtualization library
veillard redhat com  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

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