473,386 Members | 1,610 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.

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.Schema.XmlSchema
Dim io As New System.IO.FileStream(xsdFileName, System.IO.FileMode.Open,
System.IO.FileAccess.Read)
Dim x As New System.Xml.XmlTextReader(io)
xsd = System.Xml.Schema.XmlSchema.Read(x, New
System.Xml.Schema.ValidationEventHandler(AddressOf XsdValidationError))
....
....
....
Public Shared Sub XsdValidationError(ByVal sender As Object, ByVal
args As System.Xml.Schema.ValidationEventArgs)
throw new exception ("blah blah blah...")
End Sub
Oct 15 '06 #1
1 1510
"Steve" <sm*******@newsgroup.nospamwrote in message
news:73**********************************@microsof t.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.Schema.XmlSchema
Dim io As New System.IO.FileStream(xsdFileName, System.IO.FileMode.Open,
System.IO.FileAccess.Read)
Dim x As New System.Xml.XmlTextReader(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
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. ...
5
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...
5
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:...
0
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...
2
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...
1
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...
1
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...
6
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...
2
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,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
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
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,...
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...
0
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,...
0
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...

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.