XPath help
Hi,
I have a question about how to return element nodes (not only the text) with an XPath query. For example, in the following xml:
<trucks>
<truck color="blue">
<tires>four</tires>
<engine>V-8</engine>
</truck>
<truck color="green">
<tires>four</tires>
<engine>V-6</engine>
</truck>
</trucks>
if I run this XPath query: "//truck[@color='blue']" all I get back is fourV-8, but I really want to get
<truck color="blue">
<tires>four</tires>
<engine>V-8</engine>
</truck>
Does anybody know how I can do this? Or is it even possible with XPath? Maybe I just need to use DOM functions instead? Thanks in advance.
__________________
Steve
iTek Corporation
http://itekcorp.com
|