White spaces in tag names

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • matanasescu@gmail.com

    White spaces in tag names


    Maybe this question has been answered already but I wasn't able to
    find it.

    How can I use spaces in tag names?
    For example <Purge Date>

    I've tried XmlWriter.Write StartElement and
    XmlWriter.Write ElementString but they output the name as it is, which
    is incorrect from xml syntax point of view.
  • Martin Honnen

    #2
    Re: White spaces in tag names

    matanasescu@gma il.com wrote:
    How can I use spaces in tag names?
    For example <Purge Date>
    You can use XmlConvert.Enco deName("Purge Date"), see
    <URL:http://msdn2.microsoft .com/en-us/library/system.xml.xmlc onvert.encodena me.aspx>,
    the result is then "Purge_x0020_Da te".

    --

    Martin Honnen --- MVP XML

    Comment

    • matanasescu@gmail.com

      #3
      Re: White spaces in tag names

      On Feb 8, 7:05 am, Martin Honnen <mahotr...@yaho o.dewrote:
      matanase...@gma il.com wrote:
      How can I use spaces in tag names?
      For example <Purge Date>
      >
      You can use XmlConvert.Enco deName("Purge Date"), see
      <URL:http://msdn2.microsoft .com/en-us/library/system.xml.xmlc onvert.encode.. ..>,
      the result is then "Purge_x0020_Da te".
      >
      --
      >
              Martin Honnen --- MVP XML
             http://JavaScript.FAQTs.com/
      Thanks Martin, this is exactly what I need.

      Comment

      Working...