XML Reading question.
-
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>
/RootThe 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
-
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>
/RootThe 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
-
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>
/RootThe 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
Why not
<Match Name="TB_32_U" >1-North Carolina (32-2)</Match>
-
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
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
-
Why not
<Match Name="TB_32_U" >1-North Carolina (32-2)</Match>
-
Don't use data for the name of an attribute.