[xml] XSD Validation succeeds with xmllint but fails with libxml2, how do I fix this?



Hi,

I'm having a hard time getting libxml to validate a file that validates with xmllint.

I have these two files:

schema.xsd:

    <?xml version="1.0" encoding="utf-8" ?>
    <!DOCTYPE xs:schema PUBLIC "-//W3C//DTD XMLSCHEMA 200102//EN" "XMLSchema.dtd" >
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
    targetNamespace="http://example.com/XMLSchema/1.0"
    elementFormDefault="qualified"
    attributeFormDefault="unqualified">
        <xs:element name="foo">
        </xs:element>
    </xs:schema>

test.xml:

    <?xml version="1.0" encoding="UTF-8"?>
    <foo xmlns="http://example.com/XMLSchema/1.0">
    </foo>

If I run this command…

xmllint --noout --schema schema.xsd test.xml
…then I get told that the files validate.

When I however try to do the same via libxml2's C API it fails with a strange error.

Here is a more detailed description of my problem (including C source code & console output):


Anybody in here have an idea?

Cheers and thanks in advance!


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