473,385 Members | 1,893 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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

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
3 5892
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

"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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Gordon Dickens | last post by:
I have target xml to generate from schema. All of the XML instances have the same global element i.e. <base>. I would like to combine all of the schemas into a single schema where I could...
2
by: Stanimir Stamenkov | last post by:
I'm trying to find out if it is permissible to include a schema document with absent target namespace to a schema with specified target namespace, and if it is, what are the rules to resolve the...
1
by: WStoreyII | last post by:
what exactly is the difference between import and include? For Example if i had a schema called common, that had some common elements that i use such as address, phone ect. And then i created a...
4
by: Iain A. Mcleod | last post by:
Hi I'm stuck with the following schema validation problem in VS.NET 2003: I have two types of xml document and related schema: project and projectCollection. A projectcollection is just a set...
3
by: farseer | last post by:
Hello, i have a schema which also imports the XHTML schema: <xsd:import namespace="http://www.w3.org/1999/xhtml" schemaLocation="http://www.w3.org/2002/08/xhtml/xhtml1-strict.xsd"/> This...
10
by: gmocnik | last post by:
I am validating XML files on a server which has no internet access and the validadation in C# does not work. Schema with which I am validating has namespaces like:...
5
by: Sek | last post by:
Hi Folks, I would like to create a XML file that adhere to the Schema definition files. My schema definition files import/include further XSD files and internal references can be to a depth...
2
by: Simon | last post by:
I want to split a xml schema in two xml schema files where the first file has general schemas and the other part has specific schemas. The general schema can the be used by other schemas (written...
1
by: Christof Winter | last post by:
I am trying to use a webservice with SOAPpy: import SOAPpy intact_wsdl = "http://www.ebi.ac.uk/intact/binary-search-ws/binarysearch?wsdl" intact_serv = SOAPpy.WSDL.Proxy(intact_wsdl) The...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.