473,750 Members | 2,253 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Does XSD <Import> work?

Hi

Environment: Visual Studio .NET 2003 (vb)

I am developing an XSD Schema and want to include some building blocks from
another source, so they have a different namespace.
- If I use an <Include> the Schema doesn't show any of the Elements from the
include Schema. But that's to be expected because they are in a different
namespace.
- If I use <Import> the Schema doesn't show any of the Elements from the
import Schema
- If I use both <Include> and <Import> I get the same result as just using
<Import>
- If both Schemas are in the same namespace it works fine with <Include>.
But that's not what I want to do.

The documentation for Import documentation:
"....import element allows references to schema components from schema
documents with different target namespaces"

So, I conclude that <Import> doesn't work. Or is there another answer?

Without Import I can't generate Datasets.
An example below.

The same problem appears to occur when trying to add Web References (or use
the WSDL.EXE tool). It does not appear to accept <Import> directives.
Thanks
Steve

File: SCHEMA_A.XSD:
<?xml version="1.0" encoding="utf-8" ?>
<xsd:schema id="MainSchema "
elementFormDefa ult="qualified"
attributeFormDe fault="unqualif ied"
xmlns="urn:sche ma-a"
xmlns:mstns="ur n:schema-a"
xmlns:xsd="http ://www.w3.org/2001/XMLSchema"
targetNamespace ="urn:schema-a">
<xsd:import namespace="urn: schema-b" schemaLocation= "schema_b.x sd" />
<xsd:element name="Element1" >
<xsd:complexTyp e>
<xsd:sequence >
<xsd:element ref="Element2" />
<xsd:element ref="Element3" />
</xsd:sequence>
</xsd:complexType >
</xsd:element>
</xsd:schema>

File: SCHEMA_B.XSD
<?xml version="1.0" encoding="UTF-8" ?>
<xsd:schema
targetNamespace ="urn:schema-b"
xmlns:xsd="http ://www.w3.org/2001/XMLSchema"
xmlns="urn:sche ma-b"
elementFormDefa ult="qualified"
attributeFormDe fault="unqualif ied" >
<xsd:element name="Element2" >
<xsd:complexTyp e>
<xsd:sequence >
<xsd:element name="Element21 " type="Timestamp ">
</xsd:element>
<xsd:element name="Element22 " type="xsd:strin g">
</xsd:element>
</xsd:sequence>
</xsd:complexType >
</xsd:element>
<xsd:element name="Element3" >
<xsd:complexTyp e>
<xsd:sequence >
<xsd:element name="Element31 " type="xsd:strin g">
</xsd:element>
</xsd:sequence>
</xsd:complexType >
</xsd:element>
</xsd:schema>
Nov 12 '05 #1
1 4332
WSDL.exe doesnt allow for using the "include", it would give you a binding error. One way to get over this is to, have the schema inside the same xsd document.

Hope that helps.

Ash
Nov 12 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
89393
by: John Tiger | last post by:
Can anybody have idea about the difference between #include <iostream.h> and #include <iostream>. Is later one valid statement on any compiler. I tried compiling on MSVC second statement give compilation error as #include expect filename. Anu help would be appreciated. thanx, John
1
4333
by: Paul Scotchford | last post by:
Env : SLQSERVER2000 - DTS I want to import a text file with 3 fields in it ... F1: Ident char(3) F2: Note (Text) char(32,000) yeah big eh! F3: Date Field F2: has <CR><LF> thru it, this means the DTS import thinks its a multiple records to deal with as each row is also delimited by <CR><LF>,
0
1805
by: Markus Seibold | last post by:
Hello NG, sorry for pasting that much code but I just can't figure out how get the <key><keyref> to work in XML Schema. I am using XMLSpy 4.3 for editing my XML. I want to represent a recursive 1:n relationship between a database table AdminUnit (i.e., States consist of Counties).
1
2177
by: Bernd Oninger | last post by:
As far as I know one could use other xsd schemas with the import and the xlink feature. What are the differences (beside the syntax)? Bernd
12
9472
by: Sammy | last post by:
Hi, my mind is going crazy. I have tried everything I can think of to no avail. I have tried Disable Output Escaping. I tried to think of a way of enclosing the attribute data in a CDATA element. That did not parse. Here is my question: How can I get attribute values to not get converted from &apos; to '
11
3140
by: Wolfgang Kaml | last post by:
I am not sure if this is more of an expert question, but I am sure that they are out there. I'd like to setup a general application or bin directory on my Win2003.Net Server that will hold some useful utils that more pages on that server can use. As an example, I have created a Page Counter class that opens an Access .mdb file, counts the current entries for that page, and adds a new entry with some information regarding the current...
1
1327
by: seeCoolGuy | last post by:
I've been using Access to import some data straight into a sql server database by simply importing the xml file. However lately some of the newer xml files will contain vaild data such as "m<sup>3</sup>" within the tags so it reads like the following <TblPartDesriptions_to_translate> <intpartid>79</intpartid> <strpartdescription>Part Description Here</strpartdescription> <strlongdescription>some really long text here
7
5100
by: mark | last post by:
Hi All, Apologies for the newbie question but I've searched and tried all sorts for a few days and I'm pulling my hair out ; Please feel free to teach me to suck eggs because it's all new to me :) Thanks in advance, Mark.
9
2370
by: kvnsmnsn | last post by:
Over the course of my career I've transitioned from an Ada programmer (am I dating myself?) to a C programmer to a Java programmer and now back to a C programmer with the job I've currently started. What I'd like to do is write a piece of C code that inputs to the pro- gram a line written to a file. The Java code written below does exactly what I want; it writes the <String"ab cd" to file "Java.Txt" and then reads it back in to variable...
0
8999
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8836
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9394
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...
0
8260
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6803
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
4712
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
4885
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3322
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
3
2223
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.