S
Susanne Wunsch
Hi,
the attached XML file isn't bound to an XML Schema. It uses a "foreign
element" from DC namespace which is declared and bound to an XSD.
I introduced a typo in order to check the validation process. But
Xerces-J only says "Document is invalid: no grammar found.". It
doesn't check the DC element with respect to the defined XSD.
Is the XML file valid according to W3C specification?
How to figure Xerces-J forcing it to validate the DC element?
Is there another validator which does the desired task?
XML file:
<?xml version="1.0" encoding="UTF-8"?>
<abc:AAA xmlns:abc="http://example.org/">
<abc:title>AAA title</abc:title>
<dc:tite xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://purl.org/dc/elements/1.1/ http://dublincore.org/schemas/xmls/qdc/2008/02/11/dc.xsd">Document title</dc:tite>
</abc:AAA>
I use Xerces in the 'xmlvalidate' ant task:
<xmlvalidate file="${xml-file}.xml"
classname="org.apache.xerces.parsers.SAXParser"
failonerror="false">
<attribute name="http://xml.org/sax/features/validation"
value="true"/>
<attribute name="http://apache.org/xml/features/validation/schema"
value="true"/>
<attribute name="http://xml.org/sax/features/namespaces"
value="true"/>
<attribute name="http://xml.org/sax/features/namespace-prefixes"
value="true"/>
</xmlvalidate>
Any help would be approciated.
Susi
the attached XML file isn't bound to an XML Schema. It uses a "foreign
element" from DC namespace which is declared and bound to an XSD.
I introduced a typo in order to check the validation process. But
Xerces-J only says "Document is invalid: no grammar found.". It
doesn't check the DC element with respect to the defined XSD.
Is the XML file valid according to W3C specification?
How to figure Xerces-J forcing it to validate the DC element?
Is there another validator which does the desired task?
XML file:
<?xml version="1.0" encoding="UTF-8"?>
<abc:AAA xmlns:abc="http://example.org/">
<abc:title>AAA title</abc:title>
<dc:tite xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://purl.org/dc/elements/1.1/ http://dublincore.org/schemas/xmls/qdc/2008/02/11/dc.xsd">Document title</dc:tite>
</abc:AAA>
I use Xerces in the 'xmlvalidate' ant task:
<xmlvalidate file="${xml-file}.xml"
classname="org.apache.xerces.parsers.SAXParser"
failonerror="false">
<attribute name="http://xml.org/sax/features/validation"
value="true"/>
<attribute name="http://apache.org/xml/features/validation/schema"
value="true"/>
<attribute name="http://xml.org/sax/features/namespaces"
value="true"/>
<attribute name="http://xml.org/sax/features/namespace-prefixes"
value="true"/>
</xmlvalidate>
Any help would be approciated.
Susi