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

Xml Array(?) of Values

I would like to create an XML structure like so:

<Root>
<Reasons>
<Reason>value1</Reason>
<Reason>value2</Reason>
</Reason>
</Root>

I fugured start with a string[] like so:

string[] reasons = new string[] { "value1", "value2" }

and then use a foreach to make each element. Can anyone help me out
here?

Thanks for you help!
Brad

Feb 2 '07 #1
3 3100
* smithb1028 wrote in microsoft.public.dotnet.xml:
>I would like to create an XML structure like so:

<Root>
<Reasons>
<Reason>value1</Reason>
<Reason>value2</Reason>
</Reason>
</Root>

I fugured start with a string[] like so:

string[] reasons = new string[] { "value1", "value2" }

and then use a foreach to make each element. Can anyone help me out
here?
There are very many ways to create XML documents, you can simply print
them character for character, you can use an XmlWriter, you can use the
serialization features, you can create an in-memory tree using, say,
XmlDocument, any many more. You are not providing any information that
would help us help you pick one of them suitable for your problem, and
so there is little we can help you out with here.
--
Björn Höhrmann · mailto:bj****@hoehrmann.de · http://bjoern.hoehrmann.de
Weinh. Str. 22 · Telefon: +49(0)621/4309674 · http://www.bjoernsworld.de
68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/
Feb 2 '07 #2
Well I'm already using an XmlDocument to make it. I can do everything
else I need already. I just didn't know how to make an "array" like I
was describing. I figured it out...

Feb 2 '07 #3
Use the create element method of the xmldocument
See for description and an example:
http://msdn2.microsoft.com/en-us/library/fw1ys7w6.aspx

/mortb

"smithb1028" <sm****@intrepidarch.comwrote in message
news:11**********************@s48g2000cws.googlegr oups.com...
Well I'm already using an XmlDocument to make it. I can do everything
else I need already. I just didn't know how to make an "array" like I
was describing. I figured it out...

Feb 2 '07 #4

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

Similar topics

1
by: JP SIngh | last post by:
Please help me with this I have an array which has days of the month stored in it. For example at one time it might have the values 1,2,3,6,7,8,9 at another time it might have the value ...
14
by: Randell D. | last post by:
Folks, Here's my problem: I am createing an array in a file using the reslut of some PHP and MySQL processing. An example of my array would be examlpe="example one"; examlpe="example...
10
by: Geoff Cox | last post by:
Hello, I have a series of pages each of which creates an array of values. How do I keep all the array values until the last page? Cheers Geoff
7
by: Chris Wertman | last post by:
I am so lost on this one. Dim Ary as Integer = New Integer(4) {0,1,2,3} FAILS with the error: Array initializer has 1 too few elements. So I try Dim Ary as Integer = New Integer(3)...
1
by: assgar | last post by:
Hi I need help solving a porblem. I have a form that displays a checkbox, service code, description and dropdown with fees on each row. The fee_money and unit array only returns a...
1
by: DavidB | last post by:
I am working with a database and I would like to be able to populate an array at run time and then use the values that were pushed into the array as criteria for a select query. It seems that this...
7
by: sanjeevcis | last post by:
Hi, Below code is regarding to insert an array values into mysql db using php. i dont know why the code is not inserting array values into database properly. If is there any thing wrong with the...
1
by: Fareast Adam | last post by:
Anyone know how to sorting array values from least to greatest. Here the code; function mulsort($a) { sort($a); $c = count($a); for($i = 0; $i < $c; $i++) if...
5
by: Pukeko | last post by:
Hi, this is an array that is used for a dropdown menu. var imageArray = new Array( "ecwp://" + document.location.host + "/massey/images/massey/ massey_07_fullres.ecw", "ecwp://" +...
5
by: Geethu03 | last post by:
Hi i have a array values in hidden format <form name="form2" method="post" action="test.php"> <input type="hidden" name="date_val" value="<%= date %>"> <input type="hidden" name="name_val"...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.