473,785 Members | 2,282 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Validate xml instance against schema

Hi all,

I am using XMLValidatingRe ader to validate xml instance against schema.

Now my question is: in the schema, it has the target name space.
In the instance, it doesn't have the name space.
I can not add the name space into the instance, if I could do that I won't
have any problem.

Currently I use XmlTextReader, XmlValidatingRe ader or XmlDocument.
I am looking for the help to make it work without adding the name space into
the instance.
Is it doable?

TIA,

JoeZ
Mar 8 '07 #1
1 2256
"JoeZ" <jo**@microsoft .comwrote in message
news:Ob******** ******@TK2MSFTN GP02.phx.gbl...
Hi all,

I am using XMLValidatingRe ader to validate xml instance against schema.

Now my question is: in the schema, it has the target name space.
In the instance, it doesn't have the name space.
I can not add the name space into the instance, if I could do that I won't
have any problem.

Currently I use XmlTextReader, XmlValidatingRe ader or XmlDocument.
I am looking for the help to make it work without adding the name space
into the instance.
Is it doable?
No.

Either the schema has to change or the instance has to change. If the
instance documents are not going to have a namespace, then the schema needs
to not have a namespace. A schema specifying a namespace is totally
unrelated to one that does not.

John
Mar 9 '07 #2

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

Similar topics

1
1407
by: Shawn | last post by:
hi. I've created an xml document with Microsoft's XMLDOM. How can I validate the xml I've created against a schema (xsd) ? Thanks, Shawn
1
2063
by: eXavier | last post by:
Hi, I need to validate XML fragment against XSD schema. The main issue is that xml fragment does not contain refrence to schema, but I want to force the validation against the schema I have in XmlSchema object. The scenario is as follows: I have string fragment;
1
1836
by: Ryan | last post by:
I have a very complex XDR schema that uses namespaces: xmlns="urn:schemas-microsoft-com:xml-data" xmlns:b="urn:schemas-microsoft-com:BizTalkServer" xmlns:d="urn:schemas-microsoft-com:datatypes" Do I need to build a custom validator in order to validate XML documents against this schema? How does the XML parser know how to validate against the extra namespaces?
3
2355
by: Matt | last post by:
I know how to use the XmlReader to validate XML against a Schema but how do I take this one step further and get the Facet information for an invalid Xml element? I have my own validation event handler and I get the overall message about the problem but I need to report on what exactly the problem is. Does any know how to do this? Xml-Spy gives you the exact information but I need to do it programmatically with customers data and report...
6
4434
by: LesleyW | last post by:
Hi Apologies if this is a really dumb question, but being new to XML and Schemas, I wonder if giving the namespace for eg xsd or xsi as a website address means that the user has to be online when they run the app? If so, what should I do if I can't guarantee that they will be? Can I bring all these files into the app? Is that desirable? I'm about to write an app that takes an XML file as input, using Visual Studio 2005 Express and SQL...
0
993
by: RJN | last post by:
Hi The main schema includes one more schema and the actual types are described in the included schema. eg., <xs:schema xmlns:t="http://myschemas/base" xmlns=""> <xs:import schemaLocation="base.xsd" /> <xs:element name="MyObject"> <xs:complexType>
2
1784
by: John H | last post by:
Hi, How can i just use the XmlDocument object to validate an xml instanace against a schema referenced inside the xml instance? The Load method seems to not validate it against the schema. Thanks John
2
2130
by: srujana | last post by:
Hi I am validating an xml document against schema . when i am passing the xml file location as an input to the parse method String XmlDocumentUrl="E:/books.xml"; parser.parse(XmlDocumentUrl); it is working fine.
1
1594
by: JoeZ | last post by:
Hi all, I am using XMLValidatingReader to validate an xml instance against the xml schema. Currently the schema has the targetnamespace, but the instance doesn't have a namespace. Can I still use XMLValidatingReader to do the validation, without modifying either the schema or the instance? This is .NET framework 1.1.
0
9646
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
9484
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
10157
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
9957
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7505
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
5386
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
5518
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3658
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2887
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.