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

Customizing XML from DataSet

Hi all!

I have a dataset filled containing one row of data. Dataset.WriteXML gives
me this:

<Article>
<Table>
<aID>10</aID>
<aHeader>Some text goes here</aHeader>
<aDate>2003-07-04T12:06:00.0000000+02:00</aDate>
<authorID>1</authorID>
<pID>2</pID>
<authorID1>1</authorID1>
<pID1>2</pID1>
</Table>
</Article>

But I would rather have it like this:

<Article>
- <Table>
<aHeader>Some text goes here</aHeader>
<aDate>2003-07-04T12:06:00.0000000+02:00</aDate>
<authorID>1</authorID>
</Table>
</Article>

Dataset.WhiteXmlSchema gives me this:

<?xml version="1.0" ?>
- <xs:schema id="NewDataSet" xmlns=""
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
- <xs:element name="NewDataSet" msdata:IsDataSet="true"
msdata:Locale="sv-SE">
- <xs:complexType>
- <xs:choice maxOccurs="unbounded">
- <xs:element name="Table">
- <xs:complexType>
- <xs:sequence>
<xs:element name="aID" type="xs:int" minOccurs="0" />
<xs:element name="aHeader" type="xs:string" minOccurs="0" />
<xs:element name="aDate" type="xs:dateTime" minOccurs="0" />
<xs:element name="authorID" type="xs:int" minOccurs="0" />
<xs:element name="pID" type="xs:int" minOccurs="0" />
<xs:element name="authorID1" type="xs:int" minOccurs="0" />
<xs:element name="pID1" type="xs:int" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>

But I suppose I'd rather want it like this:

<?xml version="1.0" ?>
- <xs:schema id="NewDataSet" xmlns=""
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
- <xs:element name="NewDataSet" msdata:IsDataSet="true"
msdata:Locale="sv-SE">
- <xs:complexType>
- <xs:choice maxOccurs="unbounded">
- <xs:element name="Table">
- <xs:complexType>
- <xs:sequence>
<xs:element name="aHeader" type="xs:string" minOccurs="0" />
<xs:element name="aDate" type="xs:dateTime" minOccurs="0" />
<xs:element name="authorID" type="xs:int" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>

Can anybody help me? Is there any way to force the dataset into the shape of
a user-specified schema? Or would that be the wrong approach.

/john
Nov 17 '05 #1
0 1110

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

Similar topics

3
by: Peter Schwalm | last post by:
I'd like to modify the python search path depending on the source directory of the script being started. The reason is: I use a version control system, and the python scripts and modules are...
6
by: Jason | last post by:
Sorry for the post here but could not find an Exchange newgroup. I developed an application a year or 2 ago that sends SMTP email. The application allows the user to customize the text from...
1
by: Job Lot | last post by:
How can embed company logo in title section of setup dialog box?
2
by: Job Lot | last post by:
I am customizing DataGridTextBoxColumn. How can I access properties in DataGrid to which custom DataGridTextBoxColumn will be added. Say for instance, how I would access SelectionBackColor...
1
by: kjcox | last post by:
I've been using DocBook and XML for quite some time now. It works great for making simple HTML pages, http://gnuware.com/icecast/. I normally use it on RHEL and do not customize anything other than...
4
by: VR | last post by:
I am trying to embed a check box into a FlexGrid's cell, but having a problem when I start scrolling the grid. Here is my MyCheckBox class... class MyCheckBox : CheckBox { void Init (...
0
by: John Knoop | last post by:
Hi all! I have a dataset filled containing one row of data. Dataset.WriteXML gives me this: <Article> <Table> <aID>10</aID> <aHeader>Some text goes here</aHeader>...
1
by: anony | last post by:
What is the desired way to deliver a customized view of a database query? The scenario is that I want to group records based on similar fields. Can I use any built in data controls and achieve...
3
by: Stig Nielsson | last post by:
Hi, I am using a strongly typed dataset in .Net 2.0, and would like all tables to inherit from a cusomt datatable class instead of DataTable. The reason for this is that I want some common...
1
by: =?Utf-8?B?cmFuZHkxMjAw?= | last post by:
I'm working in Visual Studio 2005. I'm looking at two tables in the Data Set Designer. There's a relation between the two tables that lists 7 matching columns. Works great. One of the key...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...

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.