[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Undeclared prefix error with Xerces Java on Mac only

  • From: Michael Good <musicxml@g...>
  • To: xml-dev@l...
  • Date: Tue, 10 Mar 2009 15:23:10 -0700

Undeclared prefix error with Xerces Java on Mac only
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"?>
	<dc:title>1. Im wunderschönen Monat Mai</dc:title>
	<dc:creator>Robert Schumann</dc:creator>
	<dc:description>DICHTERLIEBE, Op. 48</dc:description>
	<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>
	<dc:type xsi:type="dcterms:DCMIType">InteractiveResource</dc:type>
	<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>

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

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.

Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.