Results 1 to 4 of 4

Thread: Changing '&' to '+' in an xml file

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2006
    Posts
    734

    Question Changing '&' to '+' in an xml file

    Hi guys,
    I was wondering how i would go about changing all occurences of the character '&' with a plus sign ('+') instead. This because i am downloading several xml files and storing the information at each node in a Database. Now because i am using .net compact framework 2 windows mobile 5 and am unable to use the .Usemneumonics property to allow an ampersand character to display. So i have decided to change every ampersand to a plus sign but because i dont know exactly where it could appear in the xml file i'd need to go through the whole file and change the character.

    How can i got about doing this?

    Thanks in advance for any help
    If your problem has been solved then please mark the thread [RESOLVED].
    If i have helped then please Rate my post

  2. #2
    Addicted Member
    Join Date
    Mar 2006
    Posts
    235

    Re: Changing '&' to '+' in an xml file

    Replace command

    VB Code:
    1. Dim strTest As String = "&&&&&&&"
    2.         MessageBox.Show(strTest.Replace("&", "+"))
    )

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2006
    Posts
    734

    Re: Changing '&' to '+' in an xml file

    Yeah i know that but is there anyway to do that before the xml file is inserted in the database?
    So it kind of goes:
    download xml file -> search xml file for '&' -> if exists replace with '+' -> insert into database.

    Its just the 2nd and 3rd step i need to know.
    Thanks.
    If your problem has been solved then please mark the thread [RESOLVED].
    If i have helped then please Rate my post

  4. #4
    Addicted Member
    Join Date
    Mar 2006
    Posts
    235

    Re: Changing '&' to '+' in an xml file

    After you download it, read it into a string, perform the replace and save it. Then import 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