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. XML / XSL
  4. Human readable XML

Human readable XML

Scheduled Pinned Locked Moved XML / XSL
c++xmlhelpquestion
2 Posts 2 Posters 3 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.
  • M Offline
    M Offline
    michaKFromParis
    wrote on last edited by
    #1

    I use the MSXML IXMLDOMDocument to load and save settings of a Visual C++ Project. My code looks like this: //create an instance of the parser hr = Document.CoCreateInstance(__uuidof(DOMDocument)); if (FAILED(hr) || (Document.p == NULL)) throw (IDS_XML_CANT_CREATE_XML_PARSER); // load the xml document file VARIANT_BOOL Success = false; hr = Document->load(CComVariant(m_szFilename), &Success); if (FAILED(hr) || !Success) throw (IDS_XML_SETTINGS_CANT_LOAD_SETTINGS); Everything works fine and is square with the MSDN recommandations. But I still have a tiny problem: I decided to use XML in order to allow my users to manually edit the conf file but right now, the parser writes everything on a single row, making it hard to read. :eek: It is important to tell the parser to write tabs, spaces and linefeeds ... but how ??? :confused:

    M 1 Reply Last reply
    0
    • M michaKFromParis

      I use the MSXML IXMLDOMDocument to load and save settings of a Visual C++ Project. My code looks like this: //create an instance of the parser hr = Document.CoCreateInstance(__uuidof(DOMDocument)); if (FAILED(hr) || (Document.p == NULL)) throw (IDS_XML_CANT_CREATE_XML_PARSER); // load the xml document file VARIANT_BOOL Success = false; hr = Document->load(CComVariant(m_szFilename), &Success); if (FAILED(hr) || !Success) throw (IDS_XML_SETTINGS_CANT_LOAD_SETTINGS); Everything works fine and is square with the MSDN recommandations. But I still have a tiny problem: I decided to use XML in order to allow my users to manually edit the conf file but right now, the parser writes everything on a single row, making it hard to read. :eek: It is important to tell the parser to write tabs, spaces and linefeeds ... but how ??? :confused:

      M Offline
      M Offline
      Michael A Barnhart
      wrote on last edited by
      #2

      Look for the whitespace settings (options). carraige returns and line feeds are just child text nodes. Your users should be able to add the linefeed text manually and not impact your reading the data back in as a last option. "I will find a new sig someday."

      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