Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Working with XML

Reply
Thread Tools

Working with XML

 
 
David Lozzi
Guest
Posts: n/a
 
      09-27-2007
Howdy,

I'm using VB.Net 2.0. Is there an easy object to use to handle XML?
Basically, i am collecting a ton of info from SQL, from various
Tables/Views/Procs, adding some data on the fly then I need to output the
entire thing to XML. I know i can create a string object and simply create
an XML string but that's messy. I know there's a XMLDocument object but I
can't seem to get it to work. Ideally, i'd like to have an XML object of
some sort and then work through it's elements/nodes and populate the
information as needed. If you could provide some sample script that'd be
great.

Thanks!
David Lozzi

 
Reply With Quote
 
 
 
 
sloan
Guest
Posts: n/a
 
      09-27-2007

To write xml, look at the XmlWriter

http://www.c-sharpcorner.com/UploadF...XmlWriter.aspx

or google it.

I think it is your "lightest weight" object for writing needs.

If you have an EXISTING xml doc, then you need to use the XmlDocument,
because you'll have to use something like

SelectNodes
SelectSingleNode

to navigate the tree, and find the correct place to insert/update data.



"David Lozzi" <> wrote in message
news:...
> Howdy,
>
> I'm using VB.Net 2.0. Is there an easy object to use to handle XML?
> Basically, i am collecting a ton of info from SQL, from various
> Tables/Views/Procs, adding some data on the fly then I need to output the
> entire thing to XML. I know i can create a string object and simply create
> an XML string but that's messy. I know there's a XMLDocument object but I
> can't seem to get it to work. Ideally, i'd like to have an XML object of
> some sort and then work through it's elements/nodes and populate the
> information as needed. If you could provide some sample script that'd be
> great.
>
> Thanks!
> David Lozzi



 
Reply With Quote
 
 
 
 
IfThenElse
Guest
Posts: n/a
 
      09-27-2007
If you manipulated data can end in a DataSet then

Dim YourDataSetThatHasAllTheMinipulatedData as
System.Data.DataSet

YourDataSetThatHasAllTheMinipulatedData.WriteXml(" XMLFile.xml")

This might help you?


"David Lozzi" <> wrote in message
news:...
> Howdy,
>
> I'm using VB.Net 2.0. Is there an easy object to use to handle XML?
> Basically, i am collecting a ton of info from SQL, from various
> Tables/Views/Procs, adding some data on the fly then I need to output the
> entire thing to XML. I know i can create a string object and simply create
> an XML string but that's messy. I know there's a XMLDocument object but I
> can't seem to get it to work. Ideally, i'd like to have an XML object of
> some sort and then work through it's elements/nodes and populate the
> information as needed. If you could provide some sample script that'd be
> great.
>
> Thanks!
> David Lozzi



 
Reply With Quote
 
IfThenElse
Guest
Posts: n/a
 
      09-27-2007
http://www.aspnettutorials.com/tutor...se/XML-vb.aspx

"David Lozzi" <> wrote in message
news:...
> Howdy,
>
> I'm using VB.Net 2.0. Is there an easy object to use to handle XML?
> Basically, i am collecting a ton of info from SQL, from various
> Tables/Views/Procs, adding some data on the fly then I need to output the
> entire thing to XML. I know i can create a string object and simply create
> an XML string but that's messy. I know there's a XMLDocument object but I
> can't seem to get it to work. Ideally, i'd like to have an XML object of
> some sort and then work through it's elements/nodes and populate the
> information as needed. If you could provide some sample script that'd be
> great.
>
> Thanks!
> David Lozzi



 
Reply With Quote
 
Alexey Smirnov
Guest
Posts: n/a
 
      09-27-2007
On Sep 27, 9:01 pm, "David Lozzi" <dlo...@nospam.nospam> wrote:
> Howdy,
>
> I'm using VB.Net 2.0. Is there an easy object to use to handle XML?
> Basically, i am collecting a ton of info from SQL, from various
> Tables/Views/Procs, adding some data on the fly then I need to output the
> entire thing to XML. I know i can create a string object and simply create
> an XML string but that's messy. I know there's a XMLDocument object but I
> can't seem to get it to work. Ideally, i'd like to have an XML object of
> some sort and then work through it's elements/nodes and populate the
> information as needed. If you could provide some sample script that'd be
> great.
>
> Thanks!
> David Lozzi


e.g. XmlTextWriter

StringWriter sw = new StringWriter();
XmlTextWriter writer = new XmlTextWriter(sw);
writer.WriteStartElement("...");
writer.WriteEndElement();
writer.Flush();
writer.Close();
sw.Close();

 
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
ElementTree.XML(string XML) and ElementTree.fromstring(string XML)not working Kee Nethery Python 12 06-27-2009 06:06 AM
Working with XML in JavaScript / Как работать с XML в Javascript'е? noff Javascript 0 06-14-2007 12:46 PM
Different results parsing a XML file with XML::Simple (XML::Sax vs. XML::Parser) Erik Wasser Perl Misc 5 03-05-2006 10:09 PM
Print XML parsing to JspWriter (out) Class org.xml.sax.helpers.NewInstance can not access a member of class javax.xml.parsers.SAXParser with modifiers "protected" Per Magnus L?vold Java 0 11-15-2004 02:27 PM
What XML technologies to learn first for "XML Processing" and "XML Mapping"? Bomb Diggy Java 0 07-28-2004 07:26 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57