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. some special charaters like while reading XML.

some special charaters like while reading XML.

Scheduled Pinned Locked Moved C / C++ / MFC
xmlhelp
2 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.
  • J Offline
    J Offline
    janaswamy uday
    wrote on last edited by
    #1

    Hi all, some special extra charaters like " " are displayed while reading the xml file using CFile. i dont want that extra charaters. Code: ---- int iSz = 0; DWORD dwFileRead; int len = (int)file.GetLength(); DWORD dwOffset=0; char* ReadAsciiBuf = new char[len+1]; _TCHAR* Readbuf = new _TCHAR[len+1]; file.SeekToBegin(); dwFileRead = file.Read(ReadAsciiBuf+dwOffset,len); memset(Readbuf, 0, (file.GetLength() + 1) * sizeof(TCHAR)); iSz = Mymbstowcs(Readbuf,ReadAsciiBuf,len); strTempResult = Readbuf; file.Close(); help me out.

    B 1 Reply Last reply
    0
    • J janaswamy uday

      Hi all, some special extra charaters like " " are displayed while reading the xml file using CFile. i dont want that extra charaters. Code: ---- int iSz = 0; DWORD dwFileRead; int len = (int)file.GetLength(); DWORD dwOffset=0; char* ReadAsciiBuf = new char[len+1]; _TCHAR* Readbuf = new _TCHAR[len+1]; file.SeekToBegin(); dwFileRead = file.Read(ReadAsciiBuf+dwOffset,len); memset(Readbuf, 0, (file.GetLength() + 1) * sizeof(TCHAR)); iSz = Mymbstowcs(Readbuf,ReadAsciiBuf,len); strTempResult = Readbuf; file.Close(); help me out.

      B Offline
      B Offline
      barneyman
      wrote on last edited by
      #2

      they're escaped characters in the XML and they're perfectly valid (http://www.w3.org/TR/1999/WD-xml-c14n-19991109.html#charescaping[^]) you're going to either have to translate them, or use an alternative xml parsing library my advice would be to use an alternative library, the effort taken to learn how to use one will be significantly less, and more rewarding, than trying to write your own, especially if you wish to consume XML generated by a third party product

      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