Advertisement

05.15.2008 at 02:26PM PDT, ID: 23406753
[x]
Attachment Details

how to read/write xml file attributes

Asked by NevSoFly in Microsoft Visual Basic.Net, Extensible Markup Language (XML)

Tags: vb.net, 2005

I would like to use an xml (Data.xml) file to store the text on buttons of my app as well as the SQL commands those buttons will trigger.  I can find plenty of examples of how to read xml nodes when the xml file is structured as below:

<?xml version="1.0" encoding="utf-8"?>
<SavedQueries>
  <Rec>
     < Button> Button1<Button/>
     <btnText> Button 1<btnText/>
     < btnSQL>SELECT * FROM Sheet1btnSQL/>
  <Rec/>
  <Rec>
     < Button> Button2<Button/>
     <btnText> Button 2<btnText/>
     < btnSQL>SELECT * FROM Sheet1btnSQL/>
  <Rec/>
 </SavedQueries>

But not when it is structured like this (this is how I would like my structure to be):

<?xml version="1.0" encoding="utf-8"?>
<SavedQueries>
  <Rec1 Button = "Button1" btnText ="Button 1" btnSQL ="SELECT * FROM Sheet1" />
  <Rec2 Button = "Button2" btnText ="Button 2" btnSQL ="SELECT * FROM Sheet1" />
  <Rec3 Button = "Button3" btnText ="Button 3" btnSQL ="SELECT * FROM Sheet1" />
  <Rec4 Button = "Button4" btnText ="Button 4" btnSQL ="SELECT * FROM Sheet1" />
  <Rec5 Button = "Button5" btnText ="Button 5" btnSQL ="SELECT * FROM Sheet1" />
  <Rec6 Button = "Button6" btnText ="Button 6" btnSQL ="SELECT * FROM Sheet1" />
  <Rec7 Button = "Button7" btnText ="Button 7" btnSQL ="SELECT * FROM Sheet1" />
  <Rec8 Button = "Button8" btnText ="Button 8" btnSQL ="SELECT * FROM Sheet1" />
 </SavedQueries>

How do I read/write to the nodes & attributes in VB.net in this way?Start Free Trial
[+][-]05.15.2008 at 02:49PM PDT, ID: 21578266

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.16.2008 at 05:50AM PDT, ID: 21582195

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Microsoft Visual Basic.Net, Extensible Markup Language (XML)
Tags: vb.net, 2005
Sign Up Now!
Solution Provided By: YoungBonzi
Participating Experts: 2
Solution Grade: A
 
 
[+][-]05.18.2008 at 05:05PM PDT, ID: 21594545

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628