473,385 Members | 1,370 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.

Multiple Schemas

Does anyone know of any good resources about using multiple schemas? I
am having trouble getting me head round a problem!

I am writing schema A which imports schema B from another namespace
(ns) and in S1 I define an element as being <element name="top"
type="ns:geometry" />. If the 'geometry' complex type is a 'top level'
complex type which contains lots of other complex types which can
describe any object, do I need to define all of these (or at least the
ones I need) again in my schema or does the fact that I've imported the
top level type mean that any instances of the lower types in my XML
will be valid?

Sorry, it's a difficult problem to describe, I'm working with GML which
is so huge it's hard to get my head round it!

Thanks

Steve

Jan 24 '06 #1
4 1188

steve_marjoribanks a écrit :
Does anyone know of any good resources about using multiple schemas? I
am having trouble getting me head round a problem!

I am writing schema A which imports schema B from another namespace
(ns) and in S1 I define an element as being <element name="top"
type="ns:geometry" />. If the 'geometry' complex type is a 'top level'
complex type which contains lots of other complex types which can
describe any object, do I need to define all of these (or at least the
ones I need) again in my schema or does the fact that I've imported the
top level type mean that any instances of the lower types in my XML
will be valid?

No, you don't. "import" is similar to "include" for the C language.
You certainly have a syntax problem in your schema definition.
Have a look at this: http://www.w3schools.com/schema/schema_intro.asp

Jan 25 '06 #2
So if I wish import a complex type into my schema which is defined in
another schema I don't have to define the complex type I want again in
my schema because the 'import' statement will mean that all of the
global elements/complex types from that schema will automatically be
valid in mine? I understand that I don't have to define/declare the
types again, but I do have to 'ref' or 'name' them, is this correct? So
if I wanted to use 3 complex types from another schema with namespace
"http://www.???.com" called, "one", "two" and "three", in my schema I
would have:

<schema ...... xmlns:no="http://www.???.org" ....... >
..
<import namespace="http://www.???.com"
schemaLocation="http://www.???.com/schema.xsd" />
..
..
..
<element name="1" type="no:one" .... />
<element name="2" type="no:two"..... />
<element name="3" type="no:three" ..... />
..
..
</schema>
Say, for example, complex types one, two and three had 'sub' types and
'super' types (not the correct terminology but I expect you know what I
mean) defined in the external schema, would an instance document of my
schema be valid if it contained instances of these 'sub' and 'super'
types or would I have to explicitly declare them in my schema?

Thanks for your help
Steve

Jan 25 '06 #3


steve_marjoribanks wrote:

I understand that I don't have to define/declare the
types again, but I do have to 'ref' or 'name' them, is this correct?


Yes, right, you import the schema for another different namespace and
then use the elements or types defined there using ref or type with a
qualified name given.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jan 25 '06 #4

steve_marjoribanks a écrit :
So if I wish import a complex type into my schema which is defined in
another schema I don't have to define the complex type I want again in
my schema because the 'import' statement will mean that all of the
global elements/complex types from that schema will automatically be
valid in mine? I understand that I don't have to define/declare the
types again, but I do have to 'ref' or 'name' them, is this correct? So
if I wanted to use 3 complex types from another schema with namespace
"http://www.???.com" called, "one", "two" and "three", in my schema I
would have:

<schema ...... xmlns:no="http://www.???.org" ....... >
.
<import namespace="http://www.???.com"
schemaLocation="http://www.???.com/schema.xsd" />
.
.
.
<element name="1" type="no:one" .... />
<element name="2" type="no:two"..... />
<element name="3" type="no:three" ..... />
.
.
</schema>
Say, for example, complex types one, two and three had 'sub' types and
'super' types (not the correct terminology but I expect you know what I
mean) defined in the external schema, would an instance document of my
schema be valid if it contained instances of these 'sub' and 'super'
types or would I have to explicitly declare them in my schema?

Thanks for your help
Steve

Don't you have an application like "xmllint" to quickly validate your
schemas ?

Jan 26 '06 #5

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

Similar topics

1
by: Steve George | last post by:
Hi, I have a scenario where I have a master schema that defines a number of complex and simple types. I then have a number of other schemas (with different namespaces) where I would like to reuse...
3
by: Matt D | last post by:
I've got two web services that use the same data types and that clients will have to consume. I read the msdn article on sharing types...
5
by: Jeff | last post by:
We are using .Net and the wsdl Utility to generate proxies to consume web services built using the BEA toolset. The data architects on the BEA side create XML schemas with various entities in...
3
by: Chris Baker | last post by:
This is a problem I have been troubleshooting for about 4-6 months. I have an e-mail form on a client's public website that is mis-behaving. It is written in ASP and uses a CDO.Message object. ...
0
by: vihrao | last post by:
I am designing wsdl that uses multiple schemas. I can do this in two ways: 1) use multiple schema imports in one wsdl or 2) use multiple schema imports in to one common schema and then import a...
3
by: jparulan | last post by:
Hi All, I'm using SOAP3.0. I was able to successfully call a WSDL file and get a value properly. But when the WSDL changed to have a MULTIPLE <element name> it was failing. This code works...
5
by: paul_zaoldyeck | last post by:
does anyone know how to validate an xml file against multiple defined schema? can you show me some examples? i'm making here an xml reader.. thank you
3
by: sejal17 | last post by:
hello Can any one tell me how to read multiple worksheets from a single excel file.I have stored that excel in xml file.so i want to read that xml that has multiple worksheet.And i want to store...
3
by: sejal17 | last post by:
hello Can any one tell me how to read multiple worksheets from a single excel file.I have stored that excel in xml file.so i want to read that xml that has multiple worksheet.And i want to store...
0
by: vigneshrao | last post by:
Hi, I have been working on a script that loops through multiple records and sends data (one record per call) to a WS. I am supposed to make a new call for each record before sending the data....
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: 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
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?

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.