Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


[xml-dev] Undeclared prefix error with Xerces Java on Mac only

From: Michael Good <musicxml@-----.--->
To: xml-dev@-----.---.---
Date: 3/10/2009 10:24:00 PM
I am running into a platform-specific XSD validation issue that has me
stumped. Hopefully this group has some advice on things to check.

I'm working on a program that validates Open Score Format files
(http://openscoreformat.sourceforge.net/). Open Score Format is an
extension of MusicXML 2.0 that, among other things, adds a standard
metadata file format. It is the validation of this metadata file that
causes the problem.

The program uses the Xerces Java 2.9.1 parser. On a Windows system
running Java 6, all validates fine. On Mac systems running Java 5,
metadata files generate the validation error:

  UndeclaredPrefix: Cannot resolve 'dcterms:W3CDTF' as a QName: the
prefix 'dcterms' is not declared.

Here is a sample file that causes the problem:

<?xml version="1.0" encoding="UTF-8"?>
<osfmeta:osf-package-metadata-baseline
xmlns:osfmeta="http://openscoreformat.sourceforge.net/osf/metadata"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:dcterms="http://purl.org/dc/terms/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.recordare.com/xsd/metadata.xsd">
	<dc:title>1. Im wunderschönen Monat Mai</dc:title>
	<dc:creator>Robert Schumann</dc:creator>
	<dc:description>DICHTERLIEBE, Op. 48</dc:description>
	<dc:publisher/>
	<dcterms:created xsi:type="dcterms:W3CDTF">2009-03-10</dcterms:created>
	<dcterms:issued xsi:type="dcterms:W3CDTF">2009-03-10</dcterms:issued>
	<dcterms:modified xsi:type="dcterms:W3CDTF">2009-03-10</dcterms:modified>
	<dcterms:dateCopyrighted
xsi:type="dcterms:W3CDTF">2009</dcterms:dateCopyrighted>
	<dc:type xsi:type="dcterms:DCMIType">InteractiveResource</dc:type>
	<dcterms:medium
xsi:type="dcterms:IMT">application/vnd.yamaha.openscoreformat.osfpvg+xml</dcterms:medium>
	<dc:identifier xsi:type="dcterms:URI">http://www.recordare.com/</dc:identifier>
	<dc:source xsi:type="dcterms:URI">http://www.recordare.com/</dc:source>
	<dc:language xsi:type="dcterms:RFC4646">und</dc:language>
	<dc:rights>Copyright © 2002 Recordare LLC</dc:rights>
	<osfmeta:meter>
		<osfmeta:beats>2</osfmeta:beats>
		<osfmeta:beat-type>4</osfmeta:beat-type>
	</osfmeta:meter>
	<osfmeta:key>
		<osfmeta:root>A</osfmeta:root>
		<osfmeta:mode>major</osfmeta:mode>
	</osfmeta:key>
</osfmeta:osf-package-metadata-baseline>

It sure looks to me like dcterms is declared! And again, it validates
fine on Windows, but not on the Mac system.

So what might be happening differently between the two systems? The
Windows system is running Java 6 while the Mac is running Java 5. But
both systems are using Xerces Java 2.9.1. Validation is being done
with the javax.xml.validation.Validator Maybe one of the systems is
actually pulling in a different SchemaFactory oe Validator? Maybe
there are different configuration defaults between systems for the
SchemaFactory, Schema, and/or Validator classes?

All the schemas, both top-level and imported, are supplied in local
versions. I double-checked and the LSResourceResolver is resolving
correctly both on Windows and Mac. The metadata.xsd file is available
in the Open Score Format SVN repository; I've temporarily put a copy
at http://www.recordare.com/xsd/metadata.xsd.

I'm still pretty new to the area of namespace-aware XSD schema
validation in Java. I get the feeling that I am missing some
boilerplate / configuration code, but after checking online
documentation and doing web searches, I still do not know where that
might be.

Thanks for any advice on how to fix this up, or how to approach fixing this up!

Best regards,

Michael Good
Recordare LLC
www.recordare.com

_______________________________________________________________________

XML-DEV is a publicly archived, unmoderated list hosted by OASIS
to support XML implementation and development. To minimize
spam in the archives, you must subscribe before posting.

[Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/
Or unsubscribe: xml-dev-unsubscribe@l...
subscribe: xml-dev-subscribe@l...
List archive: http://lists.xml.org/archives/xml-dev/
List Guidelines: http://www.oasis-open.org/maillists/guidelines.php



transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent