473,695 Members | 2,810 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 5915
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....so rry for
the useless question.
Thanks anyway,
Davide
Nov 12 '05 #2

"Davide Bedin" <re***********@ bedin.it> wrote in message
news:OC******** ******@TK2MSFTN GP10.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
2390
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 generate any of the specific instances. sample schema one: <?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"> <xs:element name="base">
2
2490
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 target namespace of the components from the included schema document. I'm confused because of the rules I read in the XML Schema spec <http://www.w3.org/TR/xmlschema-1/#element-element>: > If the <element> element information item has <schema>...
1
3361
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 schema called customers to keep track of well customers. how would i use the phone element from the common schema in the customers schema? Would I use import or include or both and if so how? Thanks. WStoreyII
4
2499
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 of projects. Therefore, I wish to include the project customType in the projectCollection namespace. I therefore have declared two xsd documents: project.xsd and projectcollection.xsd
3
1868
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 schema validates fine in XMLSpy and in VS2005. However, in Visual Studio 2005 beta2, when i attempt to reference this schema from "Templates and Add-ins" it complains that "One or more of
10
6932
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: xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:xenc="http://www.w3.org/2001/04/xmlenc#". I have these schemas all locally on the disk, but it does not work. If I try on a computer with internet access then it works just fine. Does someone know what to do. Function with...
5
2275
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 of two or three. The data required for the creation of XML are present in the form of user defined data structures.
2
5536
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 in other files) which uses the same elements. Is this possible to do?
1
5985
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 resulting error message is posted below. If I understand it right, XMLSchema.py complains about the imported XSD namespace being the same as the existing targetNamespace.
0
9129
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9004
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
6504
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5842
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4351
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4590
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3023
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2285
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
1986
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.