how to find element based on it's attribute

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
How can I determine which element a particular attribute value is associated. For example, in the xml below, if I know an attribute value name="Series A Type 1", how can I determine the element with which it is associated? (in this case, MyType). BTW, I
would then want to know its Parent and Child.
<SeriesList><br/>
<SeriesType name="Series A <br/>
<MyType name="Series A Type 1 <br/>
<MyTechinque name="My Techinque Name 1 <br/>
<MySource name="My Source Name 1" numsrcs="0 <br/>
<MyField name="Field 1" isdefault="false" /><br/>
<MyField name="Field 2" isdefault="false" /><br/>
<MyField name="Field 3" isdefault="false" /><br/>
<MyField name="Field 4" isdefault="true" /><br/>
</MySource><br/>
</MyTechinque><br/>
</MyType><br/>
<MyType name="Series A Type 2 <br/>
<MyTechinque name="My Techinque Name 2 <br/>
<MySource name="My Source Name 2" numsrcs="0 <br/>
<MyField name="Field 1" isdefault="false" /><br/>
<MyField name="Field 2" isdefault="false" /><br/>
<MyField name="Field 3" isdefault="false" /><br/>
<MyField name="Field 4" isdefault="true" /><br/>
</MySource><br/>
</MyTechinque><br/>
</MyType><br/>
</SeriesType><br/>
<SeriesType name="Series B <br/>
<MyType name="Series B Type <br/>
<MyTechinque name="My Techinque Name <br/>
<MySource name="My Source Name" numsrcs="0 <br/>
<MyField name="Field 1" isdefault="false" /><br/>
<MyField name="Field 2" isdefault="false" /><br/>
<MyField name="Field 3" isdefault="false" /><br/>
<MyField name="Field 4" isdefault="true" /><br/>
</MySource><br/>
</MyTechinque><br/>
</MyType><br/>
</SeriesType><br/>
</SeriesList>
<hr class="sig rwb

View the full article
 
Back
Top