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#
  4. How to get whitespace in xml

How to get whitespace in xml

Scheduled Pinned Locked Moved C#
c++xmlhelptutorialcareer
10 Posts 5 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
    manju 123
    wrote on last edited by
    #1

    Hi all. I am using dateset and writing the contents to xml..If there are no values to be written to xml...I want the whitespace in xml.... If i am leaving space..i.e ex string acl = " " ...in this way.. it is giving as.. .. i want is .. any help.. thank you manju

    Hi.. I am Mnaju.I have Completed my B.E Computers Science.Lokking for a job.I am interested in VC++ manju

    P P 2 Replies Last reply
    0
    • M manju 123

      Hi all. I am using dateset and writing the contents to xml..If there are no values to be written to xml...I want the whitespace in xml.... If i am leaving space..i.e ex string acl = " " ...in this way.. it is giving as.. .. i want is .. any help.. thank you manju

      Hi.. I am Mnaju.I have Completed my B.E Computers Science.Lokking for a job.I am interested in VC++ manju

      P Offline
      P Offline
      Pedram Behroozi
      wrote on last edited by
      #2

      You can declare a symbol for your whitespace, something like: "thisisawhitespace" or "nonblankspace" or ...

      While (true) { Human.isLearnable = true; }

      M 1 Reply Last reply
      0
      • P Pedram Behroozi

        You can declare a symbol for your whitespace, something like: "thisisawhitespace" or "nonblankspace" or ...

        While (true) { Human.isLearnable = true; }

        M Offline
        M Offline
        manju 123
        wrote on last edited by
        #3

        I am sorry i dint got u.. u mean to say.. string acl = "or"..

        Hi.. I am Mnaju.I have Completed my B.E Computers Science.Lokking for a job.I am interested in VC++ manju

        P 1 Reply Last reply
        0
        • M manju 123

          I am sorry i dint got u.. u mean to say.. string acl = "or"..

          Hi.. I am Mnaju.I have Completed my B.E Computers Science.Lokking for a job.I am interested in VC++ manju

          P Offline
          P Offline
          Pedram Behroozi
          wrote on last edited by
          #4

          string acl = "thisisawhitespace"; or string acl = "nonblankspace"; or Something that you can recognize it as whitespace... Seems forum couldn't show my post correctly, my pleasure :laugh:

          While (true) { Human.isLearnable = true; }

          M 1 Reply Last reply
          0
          • P Pedram Behroozi

            string acl = "thisisawhitespace"; or string acl = "nonblankspace"; or Something that you can recognize it as whitespace... Seems forum couldn't show my post correctly, my pleasure :laugh:

            While (true) { Human.isLearnable = true; }

            M Offline
            M Offline
            manju 123
            wrote on last edited by
            #5

            Pedram Behroozi wrote:

            string acl = "thisisawhitespace"; or string acl = "nonblankspace"; or

            I tried both.. but i am getting as

            nonblankspace and
            thisisawhitespace

            sorry...

            Hi.. I am Mnaju.I have Completed my B.E Computers Science.Lokking for a job.I am interested in VC++ manju

            modified on Wednesday, October 8, 2008 3:04 AM

            P 2 Replies Last reply
            0
            • M manju 123

              Pedram Behroozi wrote:

              string acl = "thisisawhitespace"; or string acl = "nonblankspace"; or

              I tried both.. but i am getting as

              nonblankspace and
              thisisawhitespace

              sorry...

              Hi.. I am Mnaju.I have Completed my B.E Computers Science.Lokking for a job.I am interested in VC++ manju

              modified on Wednesday, October 8, 2008 3:04 AM

              P Offline
              P Offline
              Pedram Behroozi
              wrote on last edited by
              #6

              When the value of a node becomes " " in XML files, you have but if it has a value it seems like YourValue so if you don't want to have in your XML file, try putting a Value in it as a WhiteSpace value, Something like values I said before or anything else and while you're reading values when you reach the "thisisawhitespace" or "nonblankspace" or ... you can understand that this is a WhiteSpace, Maybe there's some other ways to have but unfortunately I don't know anything about them. While (true) { Human.isLearnable = true; }

              A 1 Reply Last reply
              0
              • M manju 123

                Pedram Behroozi wrote:

                string acl = "thisisawhitespace"; or string acl = "nonblankspace"; or

                I tried both.. but i am getting as

                nonblankspace and
                thisisawhitespace

                sorry...

                Hi.. I am Mnaju.I have Completed my B.E Computers Science.Lokking for a job.I am interested in VC++ manju

                modified on Wednesday, October 8, 2008 3:04 AM

                P Offline
                P Offline
                Pedram Behroozi
                wrote on last edited by
                #7

                Hey, tick the "Ignore HTML tags in this message (good for code snippets)" check box. :doh:

                While (true) { Human.isLearnable = true; }

                1 Reply Last reply
                0
                • P Pedram Behroozi

                  When the value of a node becomes " " in XML files, you have but if it has a value it seems like YourValue so if you don't want to have in your XML file, try putting a Value in it as a WhiteSpace value, Something like values I said before or anything else and while you're reading values when you reach the "thisisawhitespace" or "nonblankspace" or ... you can understand that this is a WhiteSpace, Maybe there's some other ways to have but unfortunately I don't know anything about them. While (true) { Human.isLearnable = true; }

                  A Offline
                  A Offline
                  Ashfield
                  wrote on last edited by
                  #8

                  As far as I know, if you are getting the situation as described by Pedram, from a programming point of view there should be no problem as they are equivilent, but if you need to preserve the spaces have a look at xml:space="preserve" Alternatively, is it that your dataset has nulls in some fields and does not create the elements/attributes at all?

                  Bob Ashfield Consultants Ltd

                  L 1 Reply Last reply
                  0
                  • A Ashfield

                    As far as I know, if you are getting the situation as described by Pedram, from a programming point of view there should be no problem as they are equivilent, but if you need to preserve the spaces have a look at xml:space="preserve" Alternatively, is it that your dataset has nulls in some fields and does not create the elements/attributes at all?

                    Bob Ashfield Consultants Ltd

                    L Offline
                    L Offline
                    leppie
                    wrote on last edited by
                    #9

                    Thank you!!!! I was wondering when someone will actually come up with the proper answer :)

                    xacc.ide - now with TabsToSpaces support
                    IronScheme - 1.0 beta 1 - coming soon
                    ((lambda (x) `((lambda (x) ,x) ',x)) '`((lambda (x) ,x) ',x))

                    1 Reply Last reply
                    0
                    • M manju 123

                      Hi all. I am using dateset and writing the contents to xml..If there are no values to be written to xml...I want the whitespace in xml.... If i am leaving space..i.e ex string acl = " " ...in this way.. it is giving as.. .. i want is .. any help.. thank you manju

                      Hi.. I am Mnaju.I have Completed my B.E Computers Science.Lokking for a job.I am interested in VC++ manju

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

                      I use an attribute: <PUlat Align="right" Hide="false" **Null="true"** /> then if I use XSLT to transform the XML to HTML I can insert a non-breaking space in place of the null.

                      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