473,804 Members | 3,312 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

XmlSchema not loading from XmlTextReader

For some reason, the schema seems to be empty every time it's loaded. Does
anyone have any ideas?? Thanks!

Here's the code:

Dim xsd As System.Xml.Sche ma.XmlSchema
Dim io As New System.IO.FileS tream(xsdFileNa me, System.IO.FileM ode.Open,
System.IO.FileA ccess.Read)
Dim x As New System.Xml.XmlT extReader(io)
xsd = System.Xml.Sche ma.XmlSchema.Re ad(x, New
System.Xml.Sche ma.ValidationEv entHandler(Addr essOf XsdValidationEr ror))
....
....
....
Public Shared Sub XsdValidationEr ror(ByVal sender As Object, ByVal
args As System.Xml.Sche ma.ValidationEv entArgs)
throw new exception ("blah blah blah...")
End Sub
Oct 15 '06 #1
1 1533
"Steve" <sm*******@news group.nospamwro te in message
news:73******** *************** ***********@mic rosoft.com...
For some reason, the schema seems to be empty every time it's loaded. Does
anyone have any ideas?? Thanks!

Here's the code:

Dim xsd As System.Xml.Sche ma.XmlSchema
Dim io As New System.IO.FileS tream(xsdFileNa me, System.IO.FileM ode.Open,
System.IO.FileA ccess.Read)
Dim x As New System.Xml.XmlT extReader(io)
For debugging purposes, at this point in the code, try reading that into an
XmlDocument:

'' HACK: Don't ship this!
Dim __doc As New XmlDocument
__doc.Load(x)

' Now look to see what's in there
John
Oct 16 '06 #2

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

Similar topics

0
1545
by: Eric Promislow | last post by:
Has anyone else run into this? The problem is that I'm loading one schema at a time, to be displayed in a TreeView. Each node in the tree points to an item in the schema via the Tag property. When I load the second schema, the collection of SchemaTypes.Values still contains the first schema's types. This doesn't happen when I write schemas to the console. I'm explicitly clearing the Tag property on each node in the tree before I...
5
2735
by: Kurt Bauer | last post by:
I have an ASP group calendar application which pulls calendar data from Exchange via webdav into an XML string. I then loop the XML nodes to populate a collection of appointments. Finally I use the appointment collection to populate the calendar control. The performance getting the XML data is fine, but loading the data into the collection is slow. My question/problem is should I be using the collection, a dataset, or something else to...
5
5893
by: Morten Nielsen | last post by:
I'm trying to load an XML file, that references a DTD without a relative URL. This renders the error: Could not find file "C:\WINNT\system32\capabilities_1_1_0.dtd". Here's the XML I'm loading: http://maps1.intergraph.com/wms/ussample/request.asp?SERVICE=WMS&REQUEST=GetCapabilities Notice the DTD reference at the second line: <!DOCTYPE WMT_MS_Capabilities SYSTEM "capabilities_1_1_0.dtd" http://www.iter.dk/contact.aspx
0
1177
by: Sinic101 | last post by:
I'm using the following code to create an XmlSchema from an XSD file. The Read() method doesn't throw any errors and after I write the schema to a file, it looks as expected However, after the Read() method is called, m_Schema still contains no items What am I doing wrong? My .xsd file validates fine in XMLSpy // Code follow System.Xml.XmlTextReader m_XMLReader = new System.Xml.XmlTextReader(m_SchemaLocation)...
2
1900
by: Alex Shirshov | last post by:
Hello, All! It seems the bug (http://groups.google.com/groups?hl=ru&lr=&ie=UTF-8&threadm=a53b01c28a00%242 08bc860%2439ef2ecf%40TKMSFTNGXA08&rnum=8&prev=/groups%3Fq%3DschemaLocation%2 BXmlSchema%2B.NET%26hl%3Dru%26lr%3D%26ie%3DUTF-8%26selm%3Da53b01c28a00%25242 08bc860%252439ef2ecf%2540TKMSFTNGXA08%26rnum%3D8) wasn't fixed neither in v1.1 nor in v2.0. Here is exception
1
1542
by: Rumen Traykov via .NET 247 | last post by:
Have somebody had already the problem of having to write more than one XmlSchema, where some of these schemas have imports to others and respectively derived types? The imports cannot be resolved until I dont save all schemas to disk, but I cannot do this because I get an error for the derived types(which have base types from schema which is not written yet, so the import cannot be resolved). How could I solve this problem? I dont need any...
1
1572
by: hemendravyas | last post by:
Please help out in following code snippet: For the first time it gives prompt while XmlSchema.Read(). Second time schema_collection_object is not null and so does not enter into this block of code. Please help............ private static XmlSchemaCollection schema_collection_object; private static XmlSchema m_ifschema;
6
3719
by: Andrew | last post by:
I am using an XmlSerializer to save some settings and I have discovered that when a string is saved containing a cr+nl it is replaced with just a newline when loading back in. I am no expert with XML and I wonder if there is a option I have to change to fix this. I have written some simple test code to show the problem. Can anyone please tell me why the cr+nl is being replaced by just a newline and how to stop this happening? Thanks
2
4448
by: Manikrag | last post by:
Hi All, I am getting error while am loading RSS Stream in XMLDocument object. The error is as follows. "System.Xml.XmlException: '', hexadecimal value 0x19, is an invalid character. Line 18, position 32." I understand that this is becasue I have one apostrophe in the RSS Feed. I have tried few tricks to get rid of apostrophe but of no use.
0
9705
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
9575
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
10320
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
10073
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...
0
9134
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6846
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
5513
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...
2
3806
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2981
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.