Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I select elements with attributes

Status
Not open for further replies.

mcowen

Programmer
Joined
Oct 21, 2001
Messages
134
Location
GB
I have the following XML....

<VFILE_DATA>
<SCREEN CODE="IFC">
<OWNER_TYPE>case</OWNER_TYPE>
<OWNER_CODE>471</OWNER_CODE>
<GROUP_NO>0</GROUP_NO>
<FIELD NUMBER="1">
<DATA>NW01NW001</DATA>
</FIELD>
<FIELD NUMBER="2">
<DATA>18/03/04</DATA>
</FIELD>
<FIELD NUMBER="3">
<DATA>12:11</DATA>
</FIELD>
<FIELD NUMBER="4">
<DATA/>
</FIELD>


How do you specify the FIELD element I want. I actually need all of them but in different places on the page.

Thanks
Matt


Matt
 
and the answer is....

<xsl:value-of select="VFILE_DATA/SCREEN/FIELD[@NUMBER='4']/DATA"/>

Matt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top