[xsd-users] xsd does not like my xsd schema file

Boris Kolpackov boris at codesynthesis.com
Tue Jan 19 08:03:02 EST 2010


Hi Ramon,

Ramon F Herrera <ramon at forcewise.com> writes:

> The problem that I have is that xsd does not accept the xsd schema 
> files that I have provided,

It would be helpful to see the error messages you get from XSD
as well as your schemas.


> or sometimes it accepts them but the generated source code does 
> not compile.

I would definitely like to get the schema that reproduces this.


> I used the "hello" example as an initial basis. It seems that the 'hello.xsd'
> file must be built following certain conventions (IOW, I cannot simply use
> an automatically generated xsd file), such as creating a complex type
> named 'hello_t'.

No, you should be able to use your schemas regardless of the names
you use. Perhaps you are trying to use the example driver (driver.cxx)
from the hello example with your schemas. Now that won't work. You 
will need to change it to correspond to your XML vocabulary.


> Qustion: is there a sample xsd more complex/realistic than the
> 'hello.xsd' provided?

There is a number of examples in the examples/ directory in the XSD
distribution. The 'library' example might be a good starting point.
Also, if you want to see real-world schemas, you can find some on 
this page:

http://wiki.codesynthesis.com/Schemas


> <xs:element ref="some_element_down_in_the_file"/>
> 
> and xsd does not seem to handle those 'future' references.

XSD is able to handle element references without any problems as long
as the element name is actually defined (otherwise you will get an
error). I am pretty sure there is something wrong with your schemas.

Also, if you would like a quick introduction to XML Schema, you may
find this document useful:

http://www.w3.org/TR/xmlschema-0/

Boris



More information about the xsd-users mailing list