[xsd-users] Problems with generated schema

Boris Kolpackov boris at codesynthesis.com
Sun Jul 22 08:39:47 EDT 2007


Hi Olaf,

ope <ope-devel at gmx.de> writes:

> I'm using my application, e.g.
>
> $ ./bin/app -f /var/tmp/curl.metalink
> Metalink Files are: /var/tmp/curl.metalink
> /var/tmp/curl.metalink:3:60 error: Unknown element 'metalink'
> /var/tmp/curl.metalink:3:60 error: Attribute 'version' is not declared
> for element 'metalink'
>
> [...]
>
> $ cat /var/tmp/curl.metalink
> <?xml version="1.0" encoding="utf-8"?>
> <metalink version="3.0" generator="curl Metalink Generator"
> xmlns="http://www.metalinker.org/"
> type="dynamic" refreshdate="Sun, 22 Jul 2007 11:30:07 GMT">

You get these errors because XML Schema validation is enabled by
default and the parser cannot find the schema since none is
specified in the instance or elsewhere. You have three options:

1. Disable validation.

2. Add schemaLocation attributes to your XML documents.

3. Programmatically specify the schema location.

These options are discussed in more detail in Section 2, "Validaion
and Parsing" of the FAQ:

http://www.codesynthesis.com/projects/xsd/documentation/cxx/tree/faq/#2


hth,
-boris




More information about the xsd-users mailing list