Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Re: How to write xml file using existing XML Schema file?

Reply
Thread Tools

Re: How to write xml file using existing XML Schema file?

 
 
Martin Honnen
Guest
Posts: n/a
 
      11-13-2009
aspfun via DotNetMonster.com wrote:
> My app used myDataset.xmlwrite to export dataset to xml file. It works fine
> for data but first two lines need to modify as existing XML Schema file.
> Below are the difference in first two lines:
>
> New xml file:
>
> <?xml version="1.0" standalone="yes" ?>
> <NewDataSet>
> <SpecSum>
> <USER>ANDYK</USER>
> <Grouper>Allergy/Immunology</Grouper>
> <Auths>0</Auths>
> <Cost>0</Cost>
> </SpecSum>
> <SpecSum>
>
> Old xml file:
>
> <?xml version="1.0" encoding="UTF-8" ?>
> <dataroot xmlnsd="urn:schemas-microsoft-comfficedata" generated="2009-11-
> 12T09:19:20">
> <SpecSum>
> <USER>ANDYK</USER>
> <Grouper>Allergy/Immunology</Grouper>
> <Auths>0</Auths>
> <Cost>0</Cost>
> </SpecSum>
> <SpecSum>
>
> How to change?
>
> from
>
> <?xml version="1.0" standalone="yes" ?>
> <NewDataSet>
>
> to
>
> <?xml version="1.0" encoding="UTF-8" ?>
> <dataroot xmlnsd="urn:schemas-microsoft-comfficedata" generated="2009-11-
> 12T09:19:20">
>
> (generated="2009-11-12T09:19:20" wil changed based on run time)
>


You could try to create an XmlDataDocument from your DataSet and then
manipulate that XmlDataDocument and Save it e.g.
XmlDataDocument doc = new XmlDataDocument(yourDataSetInstance);
doc.DocumentElement.SetAttribute("generated",
XmlConvert.ToString(DateTime.Now));
would add that 'generated' attribute.

--

Martin Honnen --- MVP XML
http://msmvps.com/blogs/martin_honnen/
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
web.xml / XML schema issue, why do some XML schema attributes disappear asciz@starmail.com Java 3 02-20-2007 09:56 AM
Validation with XSD using XML::LibXML::Schema, and XML::Validator::Schema huntingseasonson@gmail.com Perl Misc 5 11-29-2006 12:37 PM
Why no existing Java type to existing XML schema binding support? nrm Java 3 04-10-2006 04:52 PM
[XML Schema] Including a schema document with absent target namespace to a schema with specified target namespace Stanimir Stamenkov XML 3 04-25-2005 09:59 AM



Advertisments