472,103 Members | 2,048 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,103 software developers and data experts.

Getting XML out of Dataset

Hi

Is it possible to define exactly what format the XML takes when you create it from a Dataset. I have defined a XML schema but the XML I get from the Dataset (which is a strongly typed dataset using my XML schema) doesn't use this schema ie I get the standard element type xml document.

Regards

Richard
Nov 12 '05 #1
4 1898
It sounds like you would like to output attributes instead of elements. If
this is the case then use the DataColumn.ColumnMapping property:

http://support.microsoft.com/default...b;EN-US;311937
Nov 12 '05 #2
Those are the only two methods that I have seen.
"Richard" <rp**@newsgroups.nospan> wrote in message
news:6A**********************************@microsof t.com...
Ok

So I am correct in thinking that the only way to change the output style of XML from a dataset is to use the DataColumn.ColumnMapping property? And
if you want to change the style any further you will need to use XSL
Regards

Nov 12 '05 #3
Use a Transformation and an XSLT file against the XML from WriteXML. You can
then adjust the XML to any schema you desire. As far as automatically doing
it, there is no capability built in to .NET or VS.NET.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

************************************************
Think Outside the Box!
************************************************
"Richard" <rp**@newsgroups.nospam> wrote in message
news:AD**********************************@microsof t.com...
Hi

Is it possible to define exactly what format the XML takes when you create it from a Dataset. I have defined a XML schema but the XML I get from the
Dataset (which is a strongly typed dataset using my XML schema) doesn't use
this schema ie I get the standard element type xml document.
Regards

Richard

Nov 12 '05 #4
Maybe if you try "wrapping" the dataset in an XmlDataDocument you get
something closer to what you need...

--
Daniel Cazzulino [MVP XML]
Clarius Consulting SA
http://weblogs.asp.net/cazzu
http://aspnet2.com

"Richard" <rp**@newsgroups.nospam> wrote in message
news:AD**********************************@microsof t.com...
Hi

Is it possible to define exactly what format the XML takes when you create it from a Dataset. I have defined a XML schema but the XML I get from the
Dataset (which is a strongly typed dataset using my XML schema) doesn't use
this schema ie I get the standard element type xml document.
Regards

Richard

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.690 / Virus Database: 451 - Release Date: 23/05/2004
Nov 12 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Saso Zagoranski | last post: by
3 posts views Thread by H | last post: by
reply views Thread by leo001 | last post: by

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.