how to get Python to insert special characters in an xml file?

Discussion in 'Python' started by hackingKK, Jul 15, 2011.

  1. hackingKK

    hackingKK Guest

    Hello all.
    I am currently developing a python application which reads and writes
    some data to an xml file.
    I use the elementTree library for doing this.
    My simple question is that if I have some thing like & as in "kk &
    company " as organisation name, how can I have Python take this as a
    litteral string including the & sign and put in the <orgname> </orgname>
    tag?
    Even same applies while reading the file. I would like to have the &
    come as a part of the literal string.
    Happy hacking.
    Krishnakant.
     
    hackingKK, Jul 15, 2011
    #1
    1. Advertisements

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. tonicvodka
    Replies:
    0
    Views:
    500
    tonicvodka
    Aug 15, 2005
  2. Stefan Mueller
    Replies:
    3
    Views:
    34,258
    Stefan Mueller
    Jul 23, 2006
  3. jkflens
    Replies:
    2
    Views:
    1,742
    jkflens
    May 30, 2006
  4. Replies:
    2
    Views:
    1,342
    Ingo Menger
    May 31, 2007
  5. rvino
    Replies:
    0
    Views:
    4,999
    rvino
    Aug 14, 2007
  6. Replies:
    2
    Views:
    514
    Martin Gregorie
    Jan 1, 2008
  7. Kenneth McDonald
    Replies:
    2
    Views:
    211
    Roberto Casadei
    Sep 24, 2008
  8. majna
    Replies:
    4
    Views:
    1,108
    Thomas 'PointedEars' Lahn
    Sep 19, 2007
Loading...