How to use libxml2 to validate xml with schema in version 1.1?

I use libxml2 to check xmls with a schema, and due to some I have to use a version 1.1 schema, so I started my schema header for example:

<?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning" elementFormDefault="qualified" attributeFormDefault="unqualified" vc:minVersion="1.1"> 

and I wrote a class like this:

 <xs:complexType name="test-type"> <xs:all> <xs:element name="test"></xs:element> <xs:element name="test1" minOccurs="0" maxOccurs="4"></xs:element> </xs:all> </xs:complexType> 

It is valid in version 1.1, but not valid in version 1.0. When I used my program to parse this schema:

 xmlSchemaParseCtxtPtr ctxt; xmlLineNumberDefault(1); ctxt=xmlSchemaNewParserCtxt("schema.xsd"); _xmlSchema* _schema = xmlSchemaParse(ctxt); 

I got a null pointer in _schema. But if I removed this top complexType, everything was fine. So I thought the reason for this is libxml2, which only supports the version1.0 "in my code" schema. So, is there a solution to make libxml2 work with the version1.1 schema? I have to use some of its new features. Any suggestion will help! Thanks!

+3
c ++ xml xsd libxml2
source share
1 answer

libxml2 is not updated to support XSD 1.1. As far as I know, there is no active development in the product, so this is unlikely to happen. You will need to find another processor circuit.

+3
source share

All Articles