473,657 Members | 2,667 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 1267

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

Similar topics

0
1752
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 and xml <s:schema elementFormDefault="qualified"
0
2218
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 will not perform this normalization by default. You can cause the XmlReader to perform this
1
5346
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 will not perform this normalization by default. You can cause the XmlReader to perform this...
1
2969
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 used. I'm wondering if I need to do something extra to tell the xml which schema to use.
1
2300
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. 'urn:xxx:yy:Header' element is not declared. An error occurred at , (1, 2).
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 ValidationFlags property as desired. Well, the ValidationFlags property uses the...
2
2125
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
7777
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 validating it.
0
2444
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, and no white space characters are allowed to appear before it. Line 2, position 3. Unfortunately I...
0
8402
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
8315
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,...
1
8508
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 most users, this new feature is actually very convenient. If you want to control the update process,...
1
6172
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
5633
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4164
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...
1
2733
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
2
1962
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1627
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.