473,734 Members | 2,788 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Error using ReadXmlSchema on a xsd file.

I am using some sample code from gotdotnet to Create DataSet mappings from a
xsd schema. I am geting this error. code and error below. I might mention
there is also a publictypelibra ry file with this file I may have to use it in
some way. I am very new at XML so some examples or articles would be helpfull.


The error is:

Undefined complexType 'http://www.adsml.org/typelibrary/1.1:MLItemType' is
used as a base for complex type extension."
The code Is:
Imports System
Imports System.IO
Imports System.Xml

Partial Class _Default
Inherits System.Web.UI.P age
Dim myLoadSchema As String
Dim myXmlDataDocume nt As XmlDataDocument
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArg s) Handles Me.Load

myLoadSchema = Request.MapPath ("BookingsMa in-AS.xsd")
'This file was also with this file Bookings-PublicTypeLibra ry-AS.xsd
Run(myLoadSchem a)

End Sub
Public Sub Run(ByVal args As String)
Try
myXmlDataDocume nt = New XmlDataDocument ()
Response.Write( "Creating an XmlDataDocument ...")
ParseSchema(arg s)
DisplayTableStr ucture()
Catch e As exception
Response.Write( "Exception: " & e.ToString())
End Try
End Sub

' Loads a specified schema into the DataSet
Public Sub ParseSchema(ByV al schema As String)
Dim myStreamReader As StreamReader = Nothing
Try
myStreamReader = New StreamReader(sc hema)
Response.Write( "Reading Schema file ...")

'*************
myXmlDataDocume nt.DataSet.Read XmlSchema(myStr eamReader)
'********Error is here in the ReadXmlSchema

Catch e As exception
Response.Write( "Exception: " & e.ToString())

Finally
If Not myStreamReader Is Nothing Then
myStreamReader. Close()
End If

End Try
End Sub

' Displays the DataSet tables structure
Private Sub DisplayTableStr ucture()
Response.Write( " ")
Response.Write( "Table structure")
Response.Write( " ")
Response.Write( "Tables count=" &
myXmlDataDocume nt.DataSet.Tabl es.Count.ToStri ng())

Dim i, j As Integer

For i = 0 To (myXmlDataDocum ent.DataSet.Tab les.Count - 1)
Response.Write( "TableName= '" &
myXmlDataDocume nt.DataSet.Tabl es(i).TableName & "'.")
Response.Write( "Columns count=" &
myXmlDataDocume nt.DataSet.Tabl es(i).Columns.C ount.ToString() )

For j = 0 To (myXmlDataDocum ent.DataSet.Tab les(i).Columns. Count
- 1)
Response.Write( Strings.Chr(9) & "ColumnName ='" &
myXmlDataDocume nt.DataSet.Tabl es(i).Columns(j ).ColumnName & "', type = " &
myXmlDataDocume nt.DataSet.Tabl es(i).Columns(j ).DataType.ToSt ring())
Next
Response.Write( " ")
Next
End Sub
End Class

Thank you
--
Jerry
Aug 22 '06 #1
13 2896
Hi Jerry,

You're getting this error message, because your schema might be referencing
another one. This type is not defined in your schema. Could you please post
your schema content here. Or it will be better if you point me to the
gotdotnet URL for this code sample. Thanks!

Kevin Yu
Microsoft Online Community Support

=============== =============== =============== =====
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
=============== =============== =============== =====

(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Aug 23 '06 #2
Kevin,

Thank you for the reply.

I think you are correct about this schema referencing another file. There
are two files in the distribution. I have emailed you both of the files. One
of the files has typelibrary in the filename ( this is a clue). Now the
question is how do I use these files to create the dataset from the XSD files
since there are two files. I also think there may be a collection of schemas
in this file. How do I find out how this file is constructed.

Thank you
Jerry
--
Jerry
"Kevin Yu [MSFT]" wrote:
Hi Jerry,

You're getting this error message, because your schema might be referencing
another one. This type is not defined in your schema. Could you please post
your schema content here. Or it will be better if you point me to the
gotdotnet URL for this code sample. Thanks!

Kevin Yu
Microsoft Online Community Support

=============== =============== =============== =====
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
=============== =============== =============== =====

(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Aug 23 '06 #3
keven,
Sorry I could not email you the files. online.microsof t.com gets bounced. If
you need the files please tell me how to send them to you.

Thank you,
--
Jerry
"Jerry C" wrote:
Kevin,

Thank you for the reply.

I think you are correct about this schema referencing another file. There
are two files in the distribution. I have emailed you both of the files. One
of the files has typelibrary in the filename ( this is a clue). Now the
question is how do I use these files to create the dataset from the XSD files
since there are two files. I also think there may be a collection of schemas
in this file. How do I find out how this file is constructed.

Thank you
Jerry
--
Jerry
"Kevin Yu [MSFT]" wrote:
Hi Jerry,

You're getting this error message, because your schema might be referencing
another one. This type is not defined in your schema. Could you please post
your schema content here. Or it will be better if you point me to the
gotdotnet URL for this code sample. Thanks!

Kevin Yu
Microsoft Online Community Support

=============== =============== =============== =====
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
=============== =============== =============== =====

(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Aug 23 '06 #4
Hi Jerry,

Is this a typed DataSet schema? As I assume, a typed DataSet schema is
always in one file. Not all xml schemas can be loaded as a DataSet schema.
You might need to combine them into one valid DataSet schema, since
DataSet.ReadXml Schema can only read from one file/stream.

Kevin Yu
Microsoft Online Community Support
=============== =============== =============== =====

(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Aug 24 '06 #5
Keven,

Thank you for the reply.

I am a little new at XML to know what kind of dataset this is there are
hundreds of lines of XSD in these files. I was hopping to understand how to
use these files to create datasets or what ever they were intended for. I
have found this post that talks about schemas and multiple files.

http://samples.gotdotnet.com/quickst...jectModel.aspx

I can email you the files and maybe you can give me some guidance about how
to use them. These files do open in dot.net 2005 and there is a graphical
display.

Thank you

--
Jerry
"Kevin Yu [MSFT]" wrote:
Hi Jerry,

Is this a typed DataSet schema? As I assume, a typed DataSet schema is
always in one file. Not all xml schemas can be loaded as a DataSet schema.
You might need to combine them into one valid DataSet schema, since
DataSet.ReadXml Schema can only read from one file/stream.

Kevin Yu
Microsoft Online Community Support
=============== =============== =============== =====

(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Aug 24 '06 #6
Keven,

I am testing in asp.net 2005 using VB in case you needed that info.

There is a include and several Imports in the first part of the file XSD
file I wonder if the app is finding these files. I have them in the app dir
but these Namespace= "location" does not exists. How should these be in the
file so they will be found.

This is the text of the include and Imports
<xs:include schemaLocation= "AdsMLBooki ngs-1.0-PublicTypeLibra ry-AS.xsd" />
<xs:import namespace="http ://www.adsml.org/typelibrary/1.1"
schemaLocation= "AdsMLTypeLibra ry-1.1-AS.xsd" />
<xs:import namespace="http ://www.adsml.org/controlledvocab ularies/2.0"
schemaLocation= "AdsMLControlle dVocabularies-2.0-AS.xsd" />
<xs:import namespace="http ://www.adsml.org/adsmlmaterials/1.0"
schemaLocation= "AdsMLMater ials-1.0-PublicTypeLibra ry-AS.xsd" />

Thank you
--
Jerry
"Jerry C" wrote:
Keven,

Thank you for the reply.

I am a little new at XML to know what kind of dataset this is there are
hundreds of lines of XSD in these files. I was hopping to understand how to
use these files to create datasets or what ever they were intended for. I
have found this post that talks about schemas and multiple files.

http://samples.gotdotnet.com/quickst...jectModel.aspx

I can email you the files and maybe you can give me some guidance about how
to use them. These files do open in dot.net 2005 and there is a graphical
display.

Thank you

--
Jerry
"Kevin Yu [MSFT]" wrote:
Hi Jerry,

Is this a typed DataSet schema? As I assume, a typed DataSet schema is
always in one file. Not all xml schemas can be loaded as a DataSet schema.
You might need to combine them into one valid DataSet schema, since
DataSet.ReadXml Schema can only read from one file/stream.

Kevin Yu
Microsoft Online Community Support
=============== =============== =============== =====

(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Aug 24 '06 #7
Hi Jerry,

If the files are in same directory, are the include and import tags
specifying the correct location for these files? Are all the files in that
folder? If so, and your code still doesn't work, please send these XSDs to
my mailbox. Remove 'online' from my nospam alias is my real email.

Kevin Yu
Microsoft Online Community Support
=============== =============== =============== =====

(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Aug 25 '06 #8
Keven,

Thank you for the reply.

I think you are correct about the location of the files. The tags point to a
site that does not exist.

The namespace points to:
namespace="http ://www.adsml.org/controlledvocab ularies/2.0"
which does not exist. and the schemaLocation points to:
schemaLocation= "AdsMLControlle dVocabularies-2.0-AS.xsd" />
All the xsd files are in the app directory. The question now is do I use a
full path name for the xsd file in the namespace or schemaLocation or is the
path in the namespace and the xsd file name in the schemaLocation.

I will email you the files

Thank you,

--
Jerry
"Kevin Yu [MSFT]" wrote:
Hi Jerry,

If the files are in same directory, are the include and import tags
specifying the correct location for these files? Are all the files in that
folder? If so, and your code still doesn't work, please send these XSDs to
my mailbox. Remove 'online' from my nospam alias is my real email.

Kevin Yu
Microsoft Online Community Support
=============== =============== =============== =====

(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Aug 25 '06 #9
Hi Jerry,

I've received the schema file you sent me. The schema cannot be loaded, not
because the namespace points to an invalid site. The namespace is only a
string that gives a name. It can be any string actually.

After my research, I found a type named StructuredDescr iptionsType was not
declared in your schema. It was used in file
AdsMLMaterials-1.0-PublicTypeLibra ry-AS.xsd, but never declared anywhere.

<xs:element name="Structure dDescriptions"
type="adsml-sd:StructuredDe scriptionsType" minOccurs="0" />

You need to contact the source of these .xsd files to check for this issue.
Let me know if anything is unclear.

Kevin Yu
Microsoft Online Community Support
=============== =============== =============== =====

(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Aug 28 '06 #10

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

Similar topics

11
408
by: DraguVaso | last post by:
Hi, I should use XML to synchronize the data from different (VB.NET) applications, and I was just wondering which Overloads of these functions ( ReadXmlSchema, ReadXml and WriteXml) goes the fastest? I don't think the ReadXMLSchema would give a lot of difference, but maybe the overlaods of ReadXml and WriteXml will. Especially with larges files/datatables... Should I use the IO.Stream? The XmlReader/XmlWriter?
4
2805
by: ElleEmme | last post by:
I everybody, when i try to load in a dataset an xml schema with ReadXmlSchema method, the framework validator throws an error. The schema is divide in 3 files. The main one "scheda_full.xsd" include the other "definizioni.xsd" and "tipi_dati.xsd" which contain various definitions. I try to validate the schema with many tools like xmlspy and it seems to be valid.
0
1245
by: Pete | last post by:
I am trying to load a DataSet from an xml file that has 2 tables in it. Any help would be great. Here is the C# code snipit on how I load it. Instead of geting a dataset with 2 table I am geting a dataset with 4 tables in it. All four tables have no rows. DataSet lds_working = new DataSet( "PB_TABLES"); ls_schema = MapPath("two_table.xsd"); lds_working.ReadXmlSchema(ls_schema); lds_working.ReadXml(MapPath("two_table.xml"));
0
1049
by: Peter | last post by:
I have a problem. I create a file XSD "file1" that contains simpletypes and complextypes, generate the dll, import the dll in a different XSD "file2" (of an other project). In a DataSet validate xml by "file2", but it generate the following exception: Type 'Prova.Attribute.att:complexType1' is not declared. An error occurred at file:///C:/Documents and ........ The code C# that I used is:
0
1086
by: Justin | last post by:
Greetings All, I'm trying to use the ReadXmlSchema method to define a DataSet before using the ReadXml method, and am receiving the following error: Type 'http://www.jd.com/commonReq/1.0:OrderInfo' is not declared. There are 3 schema documents that make up the entire xml schema. Order.xsd CommonReq.xsd
1
1114
by: David Bartosik [MSFT MVP] | last post by:
I am writing an xml file from a dataset. I don't want the xml file to use the table names, I don't want the schema inferred from the dataset. Because of this I created an xsd to provide an explicit schema. I create my dataset object, I set it's readxmlschema to my xsd file, then I writexml. From what I've read I expect the output to use my schema. But what I get is both schemas, my xsd and from the dataset. I can't find if I'm implementing...
1
3076
by: Ed West | last post by:
vs2005 final release, um, i can't open my typed dataset, I am getting unhelpful error. I could not find any info on it on newsgroups or web sites. anyone know of a solution? Seems to be something with getting the connection string, I do seem to have one in my settings file. of course this is extremely inconvenient because I put a lot of work into this dataset. this is another reason why I am not convinced of all these useful wizards...
9
2948
by: PeterWellington | last post by:
I have a column in a data table that stores enum values and assigns a default value: Dim dc As New DataColumn("TestEnumField", GetType(DayOfWeek)) dc.DefaultValue = DayOfWeek.Thursday When I try to serialize/deserialize dataset schema, I get the error below during deserialization: "System.ArgumentException: The DefaultValue for column TestEnumField is of
3
4435
by: Eric | last post by:
Help! I created a XML schema with a Visual Studio tools. I'm filling a dataset with a DataAdapter. Before I use the "WriteXml" method to write the data to a xml file, I want to map the XSD file I created to the dataset so that when I do use the "WriteXml" method, the generated xml file will be properly formatted to the schema I created. I did try using the "ReadXMLSchema" but it didn't work. Please help me!
0
8946
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
8776
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
9449
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8186
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
6031
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
4550
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
4809
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2724
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2180
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.