Re: Xml Array(?) of Values



* 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:bjoern@xxxxxxxxxxxx · 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/
.



Relevant Pages

  • Re: Excel Functions
    ... Two reasons: ... Now that I am able to pull the value of the character out of the string. ...
    (microsoft.public.excel.misc)
  • Re: foreach with a string and Hashtable
    ... The foreach uses the IEnumerable interface to enumerate through the ... enumerates the characters in the string. ... from the linetext variable rather than each character. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Zero terminated strings
    ... badguy.com - requests a certificate from the CA, the CA, using contact ... null byte in the middle of a string. ... A null byte has absolutely no place in character strings. ... There are good reasons for working with strings in a representation other ...
    (comp.lang.c)
  • Re: Zero terminated strings
    ... badguy.com - requests a certificate from the CA, the CA, using contact ... null byte in the middle of a string. ... A null byte has absolutely no place in character strings. ... There are good reasons for working with strings in a representation other ...
    (comp.lang.c)
  • Re: Zero terminated strings
    ... certificate authority. ... null byte in the middle of a string. ... A null byte has absolutely no place in character strings. ... There are good reasons for working with strings in a representation other than ...
    (comp.lang.c)