Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. problem with &

problem with &

Scheduled Pinned Locked Moved C / C++ / MFC
helpxmltutorial
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Arrun
    wrote on last edited by
    #1

    I am creating a XML file by using IXMLDOMNode and I am setting value to the node by using the function put_nodeValue(). But whenever I pass & it gets converted to & Similarly if I pass &gt it gets converted to > How to overcome this problem Is there any escape seqeuence that should be added before passing value to the put_nodeValue(). Pls help

    G 1 Reply Last reply
    0
    • A Arrun

      I am creating a XML file by using IXMLDOMNode and I am setting value to the node by using the function put_nodeValue(). But whenever I pass & it gets converted to & Similarly if I pass &gt it gets converted to > How to overcome this problem Is there any escape seqeuence that should be added before passing value to the put_nodeValue(). Pls help

      G Offline
      G Offline
      Gary R Wheeler
      wrote on last edited by
      #2

      The put_nodeValue method converts '&', '<', and '>' characters to their XML escape sequences &amp;, &lt;, and &gt;, respectively. Instead of 'pre-converting' them, just pass the characters.


      Software Zen: delete this;

      Fold With Us![^]

      A 1 Reply Last reply
      0
      • G Gary R Wheeler

        The put_nodeValue method converts '&', '<', and '>' characters to their XML escape sequences &amp;, &lt;, and &gt;, respectively. Instead of 'pre-converting' them, just pass the characters.


        Software Zen: delete this;

        Fold With Us![^]

        A Offline
        A Offline
        Arrun
        wrote on last edited by
        #3

        No its not converting > and < its converting only & If I pass > then only & gets converted and resultant node value is &gt;

        G 1 Reply Last reply
        0
        • A Arrun

          No its not converting > and < its converting only & If I pass > then only & gets converted and resultant node value is &gt;

          G Offline
          G Offline
          Gary R Wheeler
          wrote on last edited by
          #4

          If you are passing the characters **& g t ;**, it is converting the initial '&' and then treating the rest of the characters literally. Instead of passing the string &amp; for an '&' character, just pass the '&' character itself.


          Software Zen: delete this;

          Fold With Us![^]

          A 1 Reply Last reply
          0
          • G Gary R Wheeler

            If you are passing the characters **& g t ;**, it is converting the initial '&' and then treating the rest of the characters literally. Instead of passing the string &amp; for an '&' character, just pass the '&' character itself.


            Software Zen: delete this;

            Fold With Us![^]

            A Offline
            A Offline
            Arrun
            wrote on last edited by
            #5

            It works fine for & but not for other special charaters like > , < etc I need a solution to parse special characters other than & I will get data like >&lt, where I have to set the exact value to that node.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups