Results 1 to 5 of 5

Thread: Convert string to XML

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jun 2007
    Posts
    241

    Thumbs up Convert string to XML

    Hi,

    I am using Asp.Net 2.0 application. I have a string like

    "jason.orgstatusavailableclasskeydomorg" continuously. Actually this string like

    jason.org
    status
    available
    class key
    domorg

    I got it like jason.orgstatusavailableclasskeydomorg this .How can i convert this in xml.

    Hope your's reply.

    Thanks & Regards
    Failing to plan is Planning to fail

  2. #2
    Learning .Net danasegarane's Avatar
    Join Date
    Aug 2004
    Location
    VBForums
    Posts
    5,853

    Re: Convert string to XML

    Where do you get this string from ?
    Please mark you thread resolved using the Thread Tools as shown

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jun 2007
    Posts
    241

    Thumbs up Re: Convert string to XML

    I got this string from hash table. Now i need to convert this string to a xml file.

    Could you tell the suggestion to me???
    Failing to plan is Planning to fail

  4. #4
    Learning .Net danasegarane's Avatar
    Join Date
    Aug 2004
    Location
    VBForums
    Posts
    5,853

    Re: Convert string to XML

    Post your hash table method you are using for this one
    Please mark you thread resolved using the Thread Tools as shown

  5. #5
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Convert string to XML

    First, define your schema. Create a node for each part. For example (don't use this)

    Code:
    <userinfo>
    <site>jason.org</site>
    <stat>status</stat>
    <av>available</av>
    <ck>class key</ck>
    <domain>domorg</domain>
    </userinfo>
    You then take your string and parse it for the various keys and then create the XML. Creating the XML can occur in many different ways. Many, many, many different ways. You could write straight to an XML file using a TextWriter or you could declare a new XmlDocument and start appending elements and children to it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width