Abbey Workshop

Ant: Cannot find the declaration of element ...

I ran across an odd problem today. While trying to get Apache Ant 1.6.1 to perform schema validation on all the XML files in a directory, the following error is generated:

		
validate_project_files:
[xmlvalidate] /user/dir/path/project1.prj.xml:6:2: cvc-elt.1: 
Cannot find the declaration of element 'project'.

Here is the Ant script that would not run:

build_bad.xml

Download source for: build_bad.xml

Using Ant to do mass XML schema validation seems pretty straightforward. You create a target that contains the xmlvalidate task, create a fileset like line 7, and turn on schema validation with lines 8 and 9. (XML Schema validation is not enabled by default in the Xerces parser, which is included with Ant.) That's it, it should work, right? Well it didn't. I tried everything I could. Changed the schema link from a relative to an absolute path. Tried with and without a namespace. No change.

So taking a look at some other examples, there seemed to be a couple more options that could be added to the xmlvalidate task. So to make a long story short, adding lines 6 and 7 to the file solved the problem.

build.xml

Download source for: build.xml

Upon further review, line 6 seemed to be key. I'm guessing this is some sort of classpath problem (more than one Xerces.jar file in my classpath). However, I don't really have time to troubleshoot the problem thoroughly so that is it for now.

Google
  Web abbeyworkshop.com   

Copyright © Abbey Workshop 2006

Music Only Search
The Black MP3 Album
The MP3 Album Lyrics
Wprld Music Plus
Mp3 Songs Blog
Music Search Store
First Music Search
Mega MP3 Blog
E MP3 BLog
My MP3 Diary
Fast MP3 Finder
My Blog MP3
Mp3 Songs Mart
My MP3 Songs Album
Top Music Group
Mp3 Tune Records
Song Album Guide
Music DataDite
MP3 Buying Guide
Top MP3 Downloads
MP3 Tune Festival
FAST MP3 Downloads
MP3 Mart Online
Upper MP3
Premium MP3 Site
Music Data online
Fine MP3 Audio
Cheap Music Albums
Fine mp3 downloads
World MP3 Music Records
Mp3 Music Data Direct
The Fine Mp3
MP3 Files World
Home Music Store
DatMP3
Fat MP3 Audio
MP3 ZigZag
MP3 Songs Direct
MP3 Tune World
E MP3 Log
Boom MP3 Music
Speedy MP3
Top 20 MP3 music
Deep MP3 World
Deep MP3 Download
Best-20 MP3
Top Twenty MP3
Deep MP3
Big MP3 Guide
Deep MP3 Audio
Mp3 R.O.B.
MP3-Pop Online
Greate-20-MP3
MP3 Appear
3T-MP3