473,386 Members | 1,763 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,386 software developers and data experts.

XmlSchemaCollection and schema imports question

I am trying to validate a document against a set of schema [they are part
of a wsdl] and in order to do that, I am using XmlValidatingReader.Schemas.Add
to add the schemas.
However, since there are dependencies, the framework is crapping out (technical
term) saying that the referenced type is not available. Well, the type is
defined in the other schema which it imports. How do I get these schemas
in there first and then have it validate so the reference is not checked
until all the schemas are loaded?

BTW, this is on .NET 1.1.
Thanks

Jiho Han
Senior Software Engineer
Infinity Info Systems
The Sales Technology Experts
Tel: 212.563.4400 x216
Fax: 212.760.0540
jh**@infinityinfo.com
www.infinityinfo.com
Aug 10 '06 #1
2 1219
"Jiho Han" <ji*****@yahoo.comwrote in message
news:a1**************************@msnews.microsoft .com...
>I am trying to validate a document against a set of schema [they are part
of a wsdl] and in order to do that, I am using
XmlValidatingReader.Schemas.Add to add the schemas.
However, since there are dependencies, the framework is crapping out
(technical term) saying that the referenced type is not available. Well,
the type is defined in the other schema which it imports. How do I get
these schemas in there first and then have it validate so the reference is
not checked until all the schemas are loaded?

BTW, this is on .NET 1.1.
Do you have access to the WSDL and to the schemas it references?

If so, you can load the WSDL into a ServiceDescription object. This will
give you access to the schema locations by following the wsdl:import and
wsdl:types/xs:schema elements. You can then load them into XslSchema objects
using an XmlUrlResolver configured to permit access to the domain of the
schemas.

John
Aug 11 '06 #2
Actually, I am loading the wsdl by using ServiceDescription class.
I haven't used XmlUrlResolver.
Would you have any sample code for this? (even if pseudo)

Thanks
Jiho
"Jiho Han" <ji*****@yahoo.comwrote in message
news:a1**************************@msnews.microsoft .com...
>I am trying to validate a document against a set of schema [they are
part
of a wsdl] and in order to do that, I am using
XmlValidatingReader.Schemas.Add to add the schemas.
However, since there are dependencies, the framework is crapping out
(technical term) saying that the referenced type is not available.
Well,
the type is defined in the other schema which it imports. How do I
get
these schemas in there first and then have it validate so the
reference is
not checked until all the schemas are loaded?
BTW, this is on .NET 1.1.
Do you have access to the WSDL and to the schemas it references?

If so, you can load the WSDL into a ServiceDescription object. This
will give you access to the schema locations by following the
wsdl:import and wsdl:types/xs:schema elements. You can then load them
into XslSchema objects using an XmlUrlResolver configured to permit
access to the domain of the schemas.

John

Aug 11 '06 #3

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

Similar topics

2
by: Matthew | last post by:
I have implemented the xmlSchemaCollection object to cache commonly used schemas, as follows: =============================================================================== public void...
1
by: cmrchs | last post by:
Hi, what is the purpose of having a XmlSchemaCollection since you can only validate an xml-file against 1 xsd-file at a time ? so why have a collection ? thanks Chris ...
2
by: Che | last post by:
Greetings, I am writing an application that uses an extendible XML file. in order to validate that XML I use a main XSD and in additional - few more extensions XSD's that uses the types in the...
0
by: che | last post by:
Hi all, I am working with XSD for a while using C# objects ( XmlSchemaCollection , XmlValidatingReader) and have met this problem: Current code demonstrates the problem: <xs:schema ...>
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...
2
by: LesleyW | last post by:
I'm using a public set of schemas for GML, avaiable at www.opengis.net/gml. They all include or import each other but live in a folder hierarchy, so the import statement includes...
5
by: Norsoft | last post by:
How can I convert an existing schema to an xml document. I have a series of schema documents that validate xml documents that describe metadata. Normally the metadata is first defined in a database,...
2
by: Don Giroux | last post by:
In an earlier post that I am not able, for some reason, post a reply to, Martin Honnen responded to a Porthos question about processing XSDs using XSL. I was able to get it to work as described....
0
by: Anil Dudhani | last post by:
Dim sc As XmlSchemaCollection = New XmlSchemaCollectio when me validate one schema using sc.add("Nothing",path of xsd file") it works fine. but when validate another schema this function...
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
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...

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.