Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Shell Game with XML Attributes

0 views
Skip to first unread message

ajb...@gmail.com

unread,
Mar 22, 2005, 11:34:01 AM3/22/05
to
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.

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

unread,
Mar 22, 2005, 12:03:41 PM3/22/05
to
ajb...@gmail.com's wild thoughts were released on 22 Mar
2005 08:34:01 -0800 bearing the following fruit:

>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/]

0 new messages