Part2 csv to xml

R

rodchar

hey all,

<document>
<RecordLine>
<CoordX>3</CoordX >
<CoordY>1</CoordY >
<DataType>B</DataType >
</RecordLine>
</document>


in vb i can easily say string.split(",") and control the string from there
but i do begin to do that with xml? any good beginner .net articles on how to
do this? any words of encouragement?

thanks,
rodchar
 
C

Chris Dunaway

hey all,

<document>
<RecordLine>
<CoordX>3</CoordX >
<CoordY>1</CoordY >
<DataType>B</DataType >
</RecordLine>
</document>

in vb i can easily say string.split(",") and control the string from there
but i do begin to do that with xml? any good beginner .net articles on how to
do this? any words of encouragement?

thanks,
rodchar

Normally with xml you will use XPath or and XmlReader to navigate the
nodes of the xml. It's not clear from this post or your other post
what you are trying to accomplish. Are you trying to create xml from
some other source?

One way would be to create a class called Document that includes
properties for the data you have described above and use the Xml
Serializer to create the xml for you. But you'll need to provide more
information.

Chris
 
F

Family Tree Mike

Clearly you should use whatever format is optimal for you to solve the
required problem. XML works great for serializing objects within an
application or for interoperability between applications.

You seem to be comparing to CSV, so I will say that CSV works great
sometimes. When you run into data that the strings contain commas and
quotes, the trivial string.split(",") logic fails. Also you need to remember
to trim in case extra spaces are present.

My personal gripe on CSV reading is where the matrix is irregular, meaning
that it is not a matrix of Rows X Columns data, but rather a set of Rows
arrays of varying sizes, such as:

Honda, Pilot, Accord, Civic, Odessey
Toyota, Prius, Highlander, Camrey
Ford, Pinto

Just my 2 yen...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top