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 publictypelibrary 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.Page
Dim myLoadSchema As String
Dim myXmlDataDocument As XmlDataDocument
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
myLoadSchema = Request.MapPath("BookingsMain-AS.xsd")
'This file was also with this file Bookings-PublicTypeLibrary-AS.xsd
Run(myLoadSchema)
End Sub
Public Sub Run(ByVal args As String)
Try
myXmlDataDocument = New XmlDataDocument()
Response.Write("Creating an XmlDataDocument ...")
ParseSchema(args)
DisplayTableStructure()
Catch e As exception
Response.Write("Exception: " & e.ToString())
End Try
End Sub
' Loads a specified schema into the DataSet
Public Sub ParseSchema(ByVal schema As String)
Dim myStreamReader As StreamReader = Nothing
Try
myStreamReader = New StreamReader(schema)
Response.Write("Reading Schema file ...")
'*************
myXmlDataDocument.DataSet.ReadXmlSchema(myStreamRe ader)
'********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 DisplayTableStructure()
Response.Write(" ")
Response.Write("Table structure")
Response.Write(" ")
Response.Write("Tables count=" &
myXmlDataDocument.DataSet.Tables.Count.ToString())
Dim i, j As Integer
For i = 0 To (myXmlDataDocument.DataSet.Tables.Count - 1)
Response.Write("TableName='" &
myXmlDataDocument.DataSet.Tables(i).TableName & "'.")
Response.Write("Columns count=" &
myXmlDataDocument.DataSet.Tables(i).Columns.Count. ToString())
For j = 0 To (myXmlDataDocument.DataSet.Tables(i).Columns.Count
- 1)
Response.Write(Strings.Chr(9) & "ColumnName='" &
myXmlDataDocument.DataSet.Tables(i).Columns(j).Col umnName & "', type = " &
myXmlDataDocument.DataSet.Tables(i).Columns(j).Dat aType.ToString())
Next
Response.Write(" ")
Next
End Sub
End Class
Thank you
--
Jerry 13 2824
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.)
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.)
keven,
Sorry I could not email you the files. online.microsoft.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.)
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.ReadXmlSchema 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.)
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.ReadXmlSchema 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.)
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="AdsMLBookings-1.0-PublicTypeLibrary-AS.xsd" />
<xs:import namespace="http://www.adsml.org/typelibrary/1.1"
schemaLocation="AdsMLTypeLibrary-1.1-AS.xsd" />
<xs:import namespace="http://www.adsml.org/controlledvocabularies/2.0"
schemaLocation="AdsMLControlledVocabularies-2.0-AS.xsd" />
<xs:import namespace="http://www.adsml.org/adsmlmaterials/1.0"
schemaLocation="AdsMLMaterials-1.0-PublicTypeLibrary-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.ReadXmlSchema 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.)
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.)
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/controlledvocabularies/2.0"
which does not exist. and the schemaLocation points to:
schemaLocation="AdsMLControlledVocabularies-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.)
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 StructuredDescriptionsType was not
declared in your schema. It was used in file
AdsMLMaterials-1.0-PublicTypeLibrary-AS.xsd, but never declared anywhere.
<xs:element name="StructuredDescriptions"
type="adsml-sd:StructuredDescriptionsType" 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.)
Kevin,
Thank you for the reply,
I think I have complicated the issue by not including all the files in the
distribution. There are imports and includes in all the files I sent you so
when I included all of them in the app dir the error you found went away and
I was back to the original one in my first post. I will email you all the
files.
--
Jerry
"Kevin Yu [MSFT]" wrote:
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 StructuredDescriptionsType was not
declared in your schema. It was used in file
AdsMLMaterials-1.0-PublicTypeLibrary-AS.xsd, but never declared anywhere.
<xs:element name="StructuredDescriptions"
type="adsml-sd:StructuredDescriptionsType" 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.)
Hi Jerry,
It seems that this XSD is not a valid DataSet schema. Not all XSD files can
be loaded as a DataSet. This is a really bit schema, and it is valid. But
it cannot be as a DataSet schema, because some types in it cannot be a
DataType in a DataTable.
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.)
Kevin,
Thanks for the reply.
I am kind of new to XML. How would these files be used by asp.net to help
create XML files. Are there utilites to help format the XML to be correct for
these XSD files. some Links to articles would be helpfull
Thank you,
--
Jerry
"Kevin Yu [MSFT]" wrote:
Hi Jerry,
It seems that this XSD is not a valid DataSet schema. Not all XSD files can
be loaded as a DataSet. This is a really bit schema, and it is valid. But
it cannot be as a DataSet schema, because some types in it cannot be a
DataType in a DataTable.
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.)
Hi Jerry,
XMLSpy is a widely used tool which provides this function to help your
create/validate xml files accroding to your schema. It also have a lot of
other functions for Xml. You can download to try it. http://www.altova.com/products/xmlspy/xml_editor.html
Also, if you're developing an ASP.NET app, you can use an XmlReader to
validate your xml file. Here is a sample. http://msdn2.microsoft.com/en-us/library/8f0h7att.aspx
HTH.
Kevin Yu
Microsoft Online Community Support
==================================================
(This posting is provided "AS IS", with no warranties, and confers no
rights.) This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
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...
|
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"...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
by: Mushico |
last post by:
How to calculate date of retirement from date of birth
|
by: DJRhino |
last post by:
Was curious if anyone else was having this same issue or not....
I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM)
The start time is equivalent to 19:00 (7PM) in Central...
|
by: Aliciasmith |
last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
|
by: tracyyun |
last post by:
Hello everyone,
I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
|
by: giovanniandrean |
last post by:
The energy model is structured as follows and uses excel sheets to give input data:
1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
|
by: NeoPa |
last post by:
Introduction
For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM)
Please note that the UK and Europe revert to winter time on...
|
by: nia12 |
last post by:
Hi there,
I am very new to Access so apologies if any of this is obvious/not clear.
I am creating a data collection tool for health care employees to complete. It consists of a number of...
| |