By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,088 Members | 1,296 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,088 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
"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 discussion thread is closed

Replies have been disabled for this discussion.