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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. Problem with XMLDocument class

Problem with XMLDocument class

Scheduled Pinned Locked Moved C#
xmlhelpquestion
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.
  • M Offline
    M Offline
    Member 6074
    wrote on last edited by
    #1

    I have an XML file which contains " " While using the Load or LoadXML function of XMLDocument class, " " is converted to "\r\n".I just want to retain as " " while loading the document.Is there a way to do that?

    P 1 Reply Last reply
    0
    • M Member 6074

      I have an XML file which contains " " While using the Load or LoadXML function of XMLDocument class, " " is converted to "\r\n".I just want to retain as " " while loading the document.Is there a way to do that?

      P Offline
      P Offline
      PIEBALDconsult
      wrote on last edited by
      #2

      The " " would probably have to be encoded as "
", I hope you can fix the process that creates the file.

      M 1 Reply Last reply
      0
      • P PIEBALDconsult

        The " " would probably have to be encoded as "
", I hope you can fix the process that creates the file.

        M Offline
        M Offline
        Member 6074
        wrote on last edited by
        #3

        I tried it but it doesn't work. if i have scrpit which has something like this This is tree. This is a palace. your solution gives me This is tree. This is a palace. When i use the msxml praser and parse the script i should get the same script before parsing. The output should This is tree. This is a palace. Can u suggest me some other solution. modified on Monday, February 23, 2009 7:10 AM

        P 1 Reply Last reply
        0
        • M Member 6074

          I tried it but it doesn't work. if i have scrpit which has something like this This is tree. This is a palace. your solution gives me This is tree. This is a palace. When i use the msxml praser and parse the script i should get the same script before parsing. The output should This is tree. This is a palace. Can u suggest me some other solution. modified on Monday, February 23, 2009 7:10 AM

          P Offline
          P Offline
          PIEBALDconsult
          wrote on last edited by
          #4

          I'm not sure what you're saying. What do you mean by "output"; isn't the output of the parser simply the contents of the XmlDocument? Perhaps you're still not explaining the problem clearly. Can you show some code?

          M 1 Reply Last reply
          0
          • P PIEBALDconsult

            I'm not sure what you're saying. What do you mean by "output"; isn't the output of the parser simply the contents of the XmlDocument? Perhaps you're still not explaining the problem clearly. Can you show some code?

            M Offline
            M Offline
            Member 6074
            wrote on last edited by
            #5

            Suppose i have xml file Test1(This is not created using dotnet parser) which contains the following. " This is a test for the new block. It should all be written on separate lines of text. Using import from the client sometimes will give you a double lined in new block. " Now i am importing this file using my GUI.My GUI uses C# XMLDocument to parse file(Test1) and imports it into new dir (say NewDir).When i open this file from the NewDir the contents are as shown bellow. " This is a test of the new block. It should all be written on separate lines of text. Using import from the client sometimes will give you a double lined in new block. " If u see the " " is missing at the end of the each line.This is causing the problem.When the text under the comment tag is shown in our control a new line is added between the lines. if the file contents of the file in NewDir is same as Test1.It is working fine. Is there a way to get the contents exactly same as in the contents of Test1 using the XMLDocument class. Please let me know if more clarification is required.

            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