Validate partial schema locations

Discussion in 'XML' started by Susanne Wunsch, Mar 26, 2010.

  1. 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="">
    <abc:title>AAA title</abc:title>
    <dc:tite xmlns:dc=""
    xsi:schemaLocation="">Document title</dc:tite>

    I use Xerces in the 'xmlvalidate' ant task:

    <xmlvalidate file="${xml-file}.xml"
    <attribute name=""
    <attribute name=""
    <attribute name=""
    <attribute name=""

    Any help would be approciated.

    Susanne Wunsch, Mar 26, 2010
    1. Advertisements

  2. Different validators differ wrt whether they attend to xsi:schemaLoc,
    particularly if it's not on the document element -- some have switches
    to control this (XSV, for example), but not all. . .

    You could try moving the schemaLoc to the doc. elt. . .

    Henry S. Thompson, School of Informatics, University of Edinburgh
    Half-time member of W3C Team
    10 Crichton Street, Edinburgh EH8 9AB, SCOTLAND -- (44) 131 650-4440
    Fax: (44) 131 651-1426, e-mail:
    [mail really from me _always_ has this .sig -- mail without it is forged spam]
    Henry S. Thompson, Apr 2, 2010
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.