I am reading from an XML file to populate a combo box with the value of
an "Name" attribute to several elements. When the user selects an item
from the combo and clicks a command button, my application needs to:
1. Find the parent element of the "Name" attribute
2. Find the value of the "ID" attribute of the same element
3. Write the value of the ID attribute to another XML file.
I can do everything except steps 1 and 2 ;) I've investigated
XMLAttribute.OwnerElement and
ParentElement.Attributes(AttributeName).InnerText, but what I'm missing
is how to assign the text value of the selected item in the combo box
to an Attribute object. In other words, how do I convert a String to an
XmlAttribute? (Or an XmlElement, for that matter...)
Any help is appreciated.
>I have a problem that I suspect shouldn't be this hard to figure out,
>but I'm a .NET newbie so I'm looking for help.
.Net groups tend have 'dotnet' in them, you'll have a lot
more luck getting answers to dotnet question in one of
those.
J
>I am reading from an XML file to populate a combo box with the value of
>an "Name" attribute to several elements. When the user selects an item
>from the combo and clicks a command button, my application needs to:
>
>1. Find the parent element of the "Name" attribute
>2. Find the value of the "ID" attribute of the same element
>3. Write the value of the ID attribute to another XML file.
>
>I can do everything except steps 1 and 2 ;) I've investigated
>XMLAttribute.OwnerElement and
>ParentElement.Attributes(AttributeName).InnerText, but what I'm missing
>is how to assign the text value of the selected item in the combo box
>to an Attribute object. In other words, how do I convert a String to an
>XmlAttribute? (Or an XmlElement, for that matter...)
>
>Any help is appreciated.
Jan Hyde (VB MVP)
--
Consummate: To pull the wool over the eyes of a spouse. (Cynthia MacGregor)
[Abolish the TV Licence - http://www.tvlicensing.biz/]