By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,281 Members | 2,216 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,281 IT Pros & Developers. It's quick & easy.

Create a schema library and use import/include with XSD.exe

P: n/a
I have a "library" schema with the simple and complex types I commonly use
in other schemas and then several other schemas, maybe created by other
developers, that import/include the library schema. And then other schemas
can extend it.....

The classes created by XSD really help to make the development faster and
easier. I really would like to use XSD.exe tool as much as possible and to
avoid editing the classes defined by the tool.

If I create two different schemas (that use the library schema) XSD will
duplicate the classes defined in the library schema so I will have to manage
the colliding definitions in the class definitions.
I can create a top level schema that import/include the lower level schemas
and provide this schema to XSD.exe but from the kind of errors I receive it
seems the tool has some problems handling impor/include.

In your experience what is the best way to manage a simple or complex
library of schemas using XSD.exe?

Thanks,
Davide Bedin
Nov 12 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
I came up to the solution...it seems XSD.exe doesn't consider the
schemaLocation info for the import so you have to provide the paths of the
involved schemas to the XDS tool. That way it works perfectly....sorry for
the useless question.
Thanks anyway,
Davide
Nov 12 '05 #2

P: n/a

"Davide Bedin" <re***********@bedin.it> wrote in message
news:OC**************@TK2MSFTNGP10.phx.gbl...
I have a "library" schema with the simple and complex types I commonly use
in other schemas and then several other schemas, maybe created by other
developers, that import/include the library schema. And then other schemas
can extend it.....

The classes created by XSD really help to make the development faster and
easier. I really would like to use XSD.exe tool as much as possible and to
avoid editing the classes defined by the tool.

If I create two different schemas (that use the library schema) XSD will
duplicate the classes defined in the library schema so I will have to manage the colliding definitions in the class definitions.
I can create a top level schema that import/include the lower level schemas and provide this schema to XSD.exe but from the kind of errors I receive it seems the tool has some problems handling impor/include.

In your experience what is the best way to manage a simple or complex
library of schemas using XSD.exe?

Thanks,
Davide Bedin


In my experience, the xsd.exe tool handles import and includes without any
problems. The approach you describe in your post of creating master schemas
from a number of smaller definitions of simple and complex types sounds very
similar to my current approach to the same problem. However, I have found
using a series of XSLT transformations to produce the schemas in the first
place is also beneficial. Perhaps these could be used with your problem to
ensure there are no naming collisions in your final schema; perhaps
definitions that collide are included in the schema based on the order in
which they are defined?

I agree that you absolutely do not want to be manually amending the cs files
auto-generated by the tool. Have you looked into creating your own custom
build tool to do this automatically if necessary?

Steve James
Nov 12 '05 #3

P: n/a
Davide Bedin wrote:
I have a "library" schema with the simple and complex types I commonly use
in other schemas and then several other schemas, maybe created by other
developers, that import/include the library schema. And then other schemas
can extend it.....

The classes created by XSD really help to make the development faster and
easier. I really would like to use XSD.exe tool as much as possible and to
avoid editing the classes defined by the tool.

If I create two different schemas (that use the library schema) XSD will
duplicate the classes defined in the library schema so I will have to manage
the colliding definitions in the class definitions.
I can create a top level schema that import/include the lower level schemas
and provide this schema to XSD.exe but from the kind of errors I receive it
seems the tool has some problems handling impor/include.

In your experience what is the best way to manage a simple or complex
library of schemas using XSD.exe?

Thanks,
Davide Bedin

Hi,
I have been trying to use XSD.exe for OTA (http://www.opentravel.org)
schemas which have lots of includes and always had lots of errors. In
the end I ended up using XML SPY 5 which does the job well and uses
System.XML for parsing as well. I would recomed you give its trial
version a go. It does code generation in C# and not vb.net.

/Shaji Sethu
Nov 12 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.