473,569 Members | 2,782 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

XmlReader not using a schema when validating

I am setting up an XmlReader in .NET 2.0 beta2. I'm trying to migrate
away from the now deprecated XmlValidatingRe ader. The XML files I'm
reading have an in-line schema. I'm noticing several alarming problems:

1) The documentation for XmlReader says to use and XmlReaderSettin gs
object and to either add or remove IgnoreInlineSch ema from the
ValidationFlags property as desired. Well, the ValidationFlags property
uses the XmlSchemaValida tionFlags enumeration... which does not even
have IgnoreInlineSch ema defined. It has ProcessInlineSc hema. So, I go
ahead and add the flag since I want it to use the inline schema. Oh,
guess what... it doesn't actually apply the flags, so to get it to use
the inline schema, I have to adjust the boolean properties,
IgnoreInlineSch ema, IgnoreValidatio nWarnings, etc. to get it to work.

2) However I decide to explicitly add schemas to my XmlReader's
Settings.Schema s (either through calling
XmlReaderSettin gs.Schemas.Add( ) or XmlReader.Setti ngs.Schemas.Add ()) it
does not use the schema. I keep getting Validation Warnings of "Could
not find schema information for the element 'Any'". My schema DOES in
fact have everything defined, and when I use the old 1.1 way of doing
things (XmlValidatingR eader) everything validates as I expect it to.
So, is this a bug in XmlReader? Or is Microsoft now releasing betas
that are not feature complete? Is this beta testing or alpha testing?

3) On an unrelated note, I was under the impression that the validation
events in 2.0 were going to make res a public member instead of
private. So far, that is not the case, making ValidationEvent s in 2.0
as inane and useless to developers as they were in 1.1!

Sep 26 '05 #1
0 1264

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

Similar topics

0
1749
by: RockyH | last post by:
Hello, I'm having a problem when trying to use the XmlReader.Create(nodeReader, settings) method to validate an XML document against a schema. The problem is that if there are multiple missing required elements in the document, the validation is only picking up the first one and none of the others. For example given the following schema...
0
2216
by: Matthew Heironimus | last post by:
According to the XML 1.0 (Third Edition) W3C Recommendation (http://www.w3.org/TR/2004/REC-xml-20040204/#sec-line-ends) all #xD, #xA, and #xD#xA character combinations should be converted to a single #xA character. According to the "Reading XML with the XmlReader" section of the ".NET Framework Developer's Guide" on-line help, the...
1
5341
by: Matthew Heironimus | last post by:
According to the XML 1.0 (Third Edition) W3C Recommendation (http://www.w3.org/TR/2004/REC-xml-20040204/#sec-line-ends) all #xD, #xA, and #xD#xA character combinations should be converted to a single #xA character. According to the "Reading XML with the XmlReader" section of the ".NET Framework Developer's Guide" on-line help, the XmlReader...
1
2947
by: Andy | last post by:
I am having some trouble validating XML using the XmlValidatingReader. I have created some xml and used the visual studio to generate the schema. So I am confident that the xml and schema match. The problem I am having is that the validation event fires for each node in the xml. It seems to be completely ignoring the schema that I have...
1
2294
by: Wallace | last post by:
Hi all, I have a problem on validating a xml fragment using a single namespace schema which spread across multiple schema files using include in the master schema file. No matter how I change the xml fragment (to include default namespace xmlns='urn:xxx:yy' and any other namespace it may have), I still get the same error. ...
0
326
by: kinryuu | last post by:
I am setting up an XmlReader in .NET 2.0 beta2. I'm trying to migrate away from the now deprecated XmlValidatingReader. The XML files I'm reading have an in-line schema. I'm noticing several alarming problems: 1) The documentation for XmlReader says to use and XmlReaderSettings object and to either add or remove IgnoreInlineSchema from the...
2
2119
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
7773
by: engwar | last post by:
The title says it all. How do I use XMLDocument.Validate() against a DTD. In all my Googling about this I only find examples of how to validate an XMLReader or XmlValidatingReader against a DTD. The reason I want to avoid the readers is that I want an XmlDocument that is not forward-only so I can loop through the doc again after...
0
2433
by: gpet44 | last post by:
Hi, I have a problem receiving XML over a NetworkStream in C# .Net 2.0/3.0. I'm creating an XMLReader from the stream. I get the following exception when the XmlReaderreads from the stream as follows while(reader.Read()) { ... } System.Xml.XmlException: Unexpected XML declaration. The XML declaration must be the first node in the document,...
0
7697
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...
0
7924
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. ...
0
8120
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...
1
7672
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6283
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...
0
3653
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...
0
3640
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2113
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
0
937
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...

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.