Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > Validate partial schema locations

Reply
Thread Tools

Validate partial schema locations

 
 
Susanne Wunsch
Guest
Posts: n/a
 
      03-26-2010
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/"
xmlnssi="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
 
Reply With Quote
 
 
 
 
Henry S. Thompson
Guest
Posts: n/a
 
      04-02-2010
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. . .

ht
--
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:
URL: http://www.ltg.ed.ac.uk/~ht/
[mail really from me _always_ has this .sig -- mail without it is forged spam]
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Partial 1.0 - Partial classes for Python Thomas Heller Python 13 02-08-2007 08:12 PM
Re: Partial 1.0 - Partial classes for Python J. Clifford Dyer Python 0 02-08-2007 05:29 PM
Why? Partial Class within a Partial class Billy ASP .Net 2 02-01-2006 09:10 AM
Partial XML Schema Validation? brandon@bc3tech.net XML 9 07-27-2005 05:52 PM
[XML Schema] Including a schema document with absent target namespace to a schema with specified target namespace Stanimir Stamenkov XML 3 04-25-2005 09:59 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57