473,406 Members | 2,710 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,406 software developers and data experts.

XMLDataDocument.DataSet.ReadXML and redefining elements in an XSD file with <xs:redefine>

Hi,

The environment is .NET 2.0, the language is C# and the problem is
reading XSD file with xs:redefine section correctly to a
XMLDataDocument.DataSet.

What I am trying to do:
I am trying to create a DataSet object from an XSD file by using
XMLDataDocument class.

I'm using the method
"XMLDataDocument.DataSet.ReadXmlSchema(XSDfileloca tion)".

The XSD file that I am reading contains an <xs:redefine
schemalocation="some other schema definition.xsd"section that points
to another XSD file.

The problem:
The problem is that when the DataSet object is created, the DataSet
doesn't correspond the correct element structure - it doesn't seem to
take into account the xs:redefine section.

More information
The XSD file that I am reading: http://www.fi.ee/schemas/1.4/x_aruanne2120.xsd
The XSD file that is redefined by the file that I am reading:
http://www.fi.ee/schemas/x_headers.xsd

The element RowType exists in both files - it is "redefined" in the
first file, but the DataSet in my application shows it as it is in the
x_headers.xsd. This means that in the DataSet the DataTable "row"
contains only reference to the <reportelement, and does not contain
the columns that the "x_aruanne2120.xsd" re-defines.

Questions:
Has anyone ever stumbled to the same kind of problem? How did you
solve it?
My goal is to create a DataSet object from the XSD file,
programmatically fill it with data and then save an XML file with this
data - can you propose an alternative solution?

Thank you,
Eero R

May 7 '07 #1
2 5810
just a thought, have you tried using with an inline or referenced schema

Dataset.ReadXml(XmlLocation, ReadSchema)
http://msdn2.microsoft.com/en-us/lib...t.readxml.aspx

http://msdn2.microsoft.com/en-us/lib...lreadmode.aspx
"ER******@gmail.com" wrote:
Hi,

The environment is .NET 2.0, the language is C# and the problem is
reading XSD file with xs:redefine section correctly to a
XMLDataDocument.DataSet.

What I am trying to do:
I am trying to create a DataSet object from an XSD file by using
XMLDataDocument class.

I'm using the method
"XMLDataDocument.DataSet.ReadXmlSchema(XSDfileloca tion)".

The XSD file that I am reading contains an <xs:redefine
schemalocation="some other schema definition.xsd"section that points
to another XSD file.

The problem:
The problem is that when the DataSet object is created, the DataSet
doesn't correspond the correct element structure - it doesn't seem to
take into account the xs:redefine section.

More information
The XSD file that I am reading: http://www.fi.ee/schemas/1.4/x_aruanne2120.xsd
The XSD file that is redefined by the file that I am reading:
http://www.fi.ee/schemas/x_headers.xsd

The element RowType exists in both files - it is "redefined" in the
first file, but the DataSet in my application shows it as it is in the
x_headers.xsd. This means that in the DataSet the DataTable "row"
contains only reference to the <reportelement, and does not contain
the columns that the "x_aruanne2120.xsd" re-defines.

Questions:
Has anyone ever stumbled to the same kind of problem? How did you
solve it?
My goal is to create a DataSet object from the XSD file,
programmatically fill it with data and then save an XML file with this
data - can you propose an alternative solution?

Thank you,
Eero R

May 7 '07 #2
"werD" <we**@discussions.microsoft.comwrote in message
news:9D**********************************@microsof t.com...
just a thought, have you tried using with an inline or referenced schema

Dataset.ReadXml(XmlLocation, ReadSchema)
http://msdn2.microsoft.com/en-us/lib...t.readxml.aspx

http://msdn2.microsoft.com/en-us/lib...lreadmode.aspx
Also, have you tried reading the schema directly into a DataSet?

DataSet ds = new DataSet("dsName");
ds.ReadXmlSchema(fileName);
--
John Saunders [MVP]
May 7 '07 #3

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

Similar topics

0
by: Michael Bane | last post by:
Am I right in thinking that... 1) in <redefine> I can either extend OR restrict a type but not both? 2) in <redefine> it's not possible to change a type from say <xs:string> to <xs:integer>? ...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
0
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...
0
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...

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.