Re: [xml] XSD validation example needed

On Tue, Jan 25, 2005 at 04:08:42PM +0100, Samuel Díaz García wrote:
Well, I found the testschema.c file, thanks, but ...
... if my ROOT element has an schema asigned using this directive into 
the XML file?
<MYROOT xmlns:xsi=""; 
How can I validate it?

  If you trust the XML File content, why do you validate it ?
  If you don't trust the XML File content, how can you trust that
specific attribute value ?
  A Schemas/DTD is a contract between a provider and consumer,
I would never blindly trust a contract coming with the product, that's
why I don't believe in the whole xsi (instance schemas informations).

 Kasimier added support for it in September last year. I think you
create a schemas validation context with a NULL argument to
xmlSchemaNewValidCtxt() and try to validate the xmlDocPtr with that.

Taking the attrib value first, downloading and validate?

 That's one way too, yes.


Daniel Veillard      | Red Hat Desktop team
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]