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. XML Reading question.

XML Reading question.

Scheduled Pinned Locked Moved C#
questionhelpregexxmltutorial
6 Posts 3 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.
  • C Offline
    C Offline
    crash893
    wrote on last edited by
    #1

    Hi all, I started my first xml writeing /reading project I want to save all the text in the textboxes of the form to an xml file ( save file) and then load it back later. I have the writing XML down ( i think please let me know if you have ideas) but here is an example of my output

    ?xml version="1.0" encoding="UTF-8"?
    Root
    FileInfo
    Region Region="Region1" /
    TourName TourName="mens2006" /
    Username Username="rbarbrow" /
    timestamp TimeStamp="9/2/2008 1:25:26 AM" /
    /FileInfo
    MatchInfo
    Match TB_32_C="No Chatter" /
    Match TB_32_U="1-North Carolina (32-2)" /
    Match TB_32_L="16- Play-In-Winner" /
    Match TB_32_S="Raliegh, N.C., Friday 7:10" /
    Match TB_33_C="No Chatter" />
    Match TB_33_U="8-Indiana (25-7)" /
    Match TB_33_L="9-Arkansas (22-11)" /
    Match TB_33_S="Ralegh, N.C., Friday, 9:30" /
    /MatchInfo>
    /Root

    The idea is that i have textboxes TB_##_(U,S,L,C) and that i can read what textbox and what text and then read the text back in the problem is that i can read the text with the .getattribute(i) method ("no chatter" or "1-North Carolina (32-2)") but i can not read the attribute name ( TB_32_C or TB_32_U) So question 1 is: How do i read the Attribute NAME? question 2 is there a way to read only things in the MatchInfo Node? ( if node is the right word) Thanks so much for any help

    A P 2 Replies Last reply
    0
    • C crash893

      Hi all, I started my first xml writeing /reading project I want to save all the text in the textboxes of the form to an xml file ( save file) and then load it back later. I have the writing XML down ( i think please let me know if you have ideas) but here is an example of my output

      ?xml version="1.0" encoding="UTF-8"?
      Root
      FileInfo
      Region Region="Region1" /
      TourName TourName="mens2006" /
      Username Username="rbarbrow" /
      timestamp TimeStamp="9/2/2008 1:25:26 AM" /
      /FileInfo
      MatchInfo
      Match TB_32_C="No Chatter" /
      Match TB_32_U="1-North Carolina (32-2)" /
      Match TB_32_L="16- Play-In-Winner" /
      Match TB_32_S="Raliegh, N.C., Friday 7:10" /
      Match TB_33_C="No Chatter" />
      Match TB_33_U="8-Indiana (25-7)" /
      Match TB_33_L="9-Arkansas (22-11)" /
      Match TB_33_S="Ralegh, N.C., Friday, 9:30" /
      /MatchInfo>
      /Root

      The idea is that i have textboxes TB_##_(U,S,L,C) and that i can read what textbox and what text and then read the text back in the problem is that i can read the text with the .getattribute(i) method ("no chatter" or "1-North Carolina (32-2)") but i can not read the attribute name ( TB_32_C or TB_32_U) So question 1 is: How do i read the Attribute NAME? question 2 is there a way to read only things in the MatchInfo Node? ( if node is the right word) Thanks so much for any help

      A Offline
      A Offline
      AhsanS
      wrote on last edited by
      #2

      How do i read the Attribute NAME? Use XmlTextReader is there a way to read only things in the MatchInfo Node Use XmlNode

      Ahsan Ullah Senior Software Engineer

      C 1 Reply Last reply
      0
      • C crash893

        Hi all, I started my first xml writeing /reading project I want to save all the text in the textboxes of the form to an xml file ( save file) and then load it back later. I have the writing XML down ( i think please let me know if you have ideas) but here is an example of my output

        ?xml version="1.0" encoding="UTF-8"?
        Root
        FileInfo
        Region Region="Region1" /
        TourName TourName="mens2006" /
        Username Username="rbarbrow" /
        timestamp TimeStamp="9/2/2008 1:25:26 AM" /
        /FileInfo
        MatchInfo
        Match TB_32_C="No Chatter" /
        Match TB_32_U="1-North Carolina (32-2)" /
        Match TB_32_L="16- Play-In-Winner" /
        Match TB_32_S="Raliegh, N.C., Friday 7:10" /
        Match TB_33_C="No Chatter" />
        Match TB_33_U="8-Indiana (25-7)" /
        Match TB_33_L="9-Arkansas (22-11)" /
        Match TB_33_S="Ralegh, N.C., Friday, 9:30" /
        /MatchInfo>
        /Root

        The idea is that i have textboxes TB_##_(U,S,L,C) and that i can read what textbox and what text and then read the text back in the problem is that i can read the text with the .getattribute(i) method ("no chatter" or "1-North Carolina (32-2)") but i can not read the attribute name ( TB_32_C or TB_32_U) So question 1 is: How do i read the Attribute NAME? question 2 is there a way to read only things in the MatchInfo Node? ( if node is the right word) Thanks so much for any help

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

        Why not <Match Name="TB_32_U" >1-North Carolina (32-2)</Match>

        C 1 Reply Last reply
        0
        • A AhsanS

          How do i read the Attribute NAME? Use XmlTextReader is there a way to read only things in the MatchInfo Node Use XmlNode

          Ahsan Ullah Senior Software Engineer

          C Offline
          C Offline
          crash893
          wrote on last edited by
          #4

          my cup runith over Like i said in my orginal post this is my first time working with XML at all let alone in c# I got the xml reader part thats how i am able to get the atrubut value. however when you create a new attrubute you give it a Name AND a value i can read the value of the attrubute but i can not figure out how to get the orginal name ( in this case the textboxs name) I have no idea what you implying with the use xmlnode

          1 Reply Last reply
          0
          • P PIEBALDconsult

            Why not <Match Name="TB_32_U" >1-North Carolina (32-2)</Match>

            C Offline
            C Offline
            crash893
            wrote on last edited by
            #5

            I'm not sure i follow

            P 1 Reply Last reply
            0
            • C crash893

              I'm not sure i follow

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

              Don't use data for the name of an attribute.

              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