[xsd-users] Problems with generated schema

ope ope-devel at gmx.de
Sun Jul 22 07:59:57 EDT 2007


>> I build a tree parser for the metalink schema at
>> http://www.metalinker.org/schema/3.0/metalink.xsd by:
>>
>> [...]
>>
>> and get a lot of errors:
>>
>>
>> metalink.xsd:2:216 error: Unknown element 'xs:schema'
> 
> Are you getting these errors when running XSD or your application?
> If it is your application then it is not clear why you are parsing
> the schema itself (metalink.xsd). I would expect you to try it on
> some XML document of the metalink vocabulary.

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'
/var/tmp/curl.metalink:3:60 error: Attribute 'generator' is not declared
for element 'metalink'
/var/tmp/curl.metalink:3:60 error: Attribute 'xmlns' is not declared for
element 'metalink'
/var/tmp/curl.metalink:3:60 error: Attribute 'type' is not declared for
element 'metalink'
/var/tmp/curl.metalink:3:60 error: Attribute 'refreshdate' is not
declared for element 'metalink'
/var/tmp/curl.metalink:4:12 error: Unknown element 'publisher'
/var/tmp/curl.metalink:5:7 error: Unknown element 'name'
/var/tmp/curl.metalink:6:6 error: Unknown element 'url'
/var/tmp/curl.metalink:8:14 error: Unknown element 'description'
/var/tmp/curl.metalink:9:8 error: Unknown element 'files'
/var/tmp/curl.metalink:9:40 error: Unknown element 'file'
/var/tmp/curl.metalink:9:40 error: Attribute 'name' is not declared for
element 'file'
/var/tmp/curl.metalink:10:10 error: Unknown element 'version'
[...]

$ 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">
<publisher>
<name>curl</name>
<url>http://curl.haxx.se/</url>
</publisher>
<description>curl Generic source tar, gzip</description>
<files><file name="curl-7.16.4.tar.gz">
<version>7.16.4</version>
<size>2127522</size>
<verification>
<hash type="md5">b8f272cfe98fd5570447469e2faea844</hash>
<hash type="sha1">9c0c64061e41fa49f2a3fb1cb5334303d49f425b</hash>
<hash type="pgp" file="curl-7.16.4.tar.gz.asc">
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQBGk+mGeOEcayedXJERAlePAJ9eR6VlBzdZHvzquiRQu70GSIwZdQCeIFA4
J+7PsoXJwIZvrMSS6/lih0o=
=qYpL
-----END PGP SIGNATURE-----
</hash>
</verification>
<!-- resource preferences are for use in Germany -->
<resources>
<url type="ftp" location="au"
preference="30">ftp://ftp.planetmirror.com/pub/curl/curl-7.16.4.tar.gz</url>
<url type="http" location="at"
preference="70">http://gd.tuwien.ac.at/utils/archivers/curl/curl-7.16.4.tar.gz</url>
[...]
</resources>
</file></files>
</metalink>

Creating of xsd's header and source using the options mentioned before
doesn't result in any errors.

>> Anyway, how can I rename the anonymous types with useful names other
>> than counted version1 (or hash1 by use of xsd 3.0.0b2)?
> 
> Use the --anonymous-regex option. For details see the XSD Compiler
> Command Line Manual:
> 
> http://www.codesynthesis.com/projects/xsd/documentation/xsd.xhtml
> 
> and FAQ 1.1:
> 
> http://www.codesynthesis.com/projects/xsd/documentation/cxx/tree/faq/#1.1

I will try it.

Thanks,
Olaf




More information about the xsd-users mailing list