[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

trying to query based on attribute value



	
Please help.

I am using a slightly enhanced version of /samples/XML/Query.java.

A fragment of my XML looks like this:

<artistinfo>
     <song id="595">
         <s_title>Title 1</s_title>
     </song>
     <song id="596">
         <s_title>Title 2</s_title>
     </song>
</artistinfo>

 From the command line, if I do:
java Query artist_info.xml /artistinfo/song

This prints both song nodes and all elements & values before it.

I want only the info from song with attribute id=595; how do I do this?

I tried: java Query artist_info.xml /artistinfo/song:id=595

with output: Query-Result (Boolean): false

Could somebody out there give me the correct syntax? I can't find it in any 
docs anywhere.

Thanks,
Steve Evans