You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xalan.apache.org by tom john <cy...@yahoo.com> on 2002/01/02 17:40:18 UTC

using xpath

hi,

i have xml file similar to the following:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<addbook>
   	<person>
   		<firstname>AAA</name>
   		<lastname>ZZZ</lastname>
   		<telephone>11111</telephone>
   	</person>
	<person>
   		<firstname>BBB</name>
   		<lastname>YYY</lastname>
   		<telephone>22222</telephone>
   	</person>
   	<person>
   		<firstname>CCC</name>
   		<lastname>XXX</lastname>
   		<telephone>33333</telephone>
   	</person>
</addbook>

I would like to get the person node when i give the
first and the last name. 

for example if i give:
firstname = BBB & lastname = YYY

i should get 

<person>
  <firstname>BBB</name>
  <lastname>YYY</lastname>
  <telephone>22222</telephone>
</person>


Is it possible using XPath? How?
Hope someone can help.

tom

__________________________________________________
Do You Yahoo!?
Send your FREE holiday greetings online!
http://greetings.yahoo.com

RE: using xpath

Posted by Gary L Peskin <ga...@firstech.com>.
Generic questions such as these should be referred to the Mulberry list
(http://www.mulberrytech.com/xsl/xsl-list/index.html).

Thanks,
Gary

> -----Original Message-----
> From: tom john [mailto:cybernv@yahoo.com] 
> Sent: Wednesday, January 02, 2002 8:40 AM
> To: xalan-j-users@xml.apache.org
> Subject: using xpath
> 
> 
> hi,
> 
> i have xml file similar to the following:
> 
> <?xml version="1.0" encoding="UTF-8" standalone="no"?> <addbook>
>    	<person>
>    		<firstname>AAA</name>
>    		<lastname>ZZZ</lastname>
>    		<telephone>11111</telephone>
>    	</person>
> 	<person>
>    		<firstname>BBB</name>
>    		<lastname>YYY</lastname>
>    		<telephone>22222</telephone>
>    	</person>
>    	<person>
>    		<firstname>CCC</name>
>    		<lastname>XXX</lastname>
>    		<telephone>33333</telephone>
>    	</person>
> </addbook>
> 
> I would like to get the person node when i give the
> first and the last name. 
> 
> for example if i give:
> firstname = BBB & lastname = YYY
> 
> i should get 
> 
> <person>
>   <firstname>BBB</name>
>   <lastname>YYY</lastname>
>   <telephone>22222</telephone>
> </person>
> 
> 
> Is it possible using XPath? How?
> Hope someone can help.
> 
> tom
> 
> __________________________________________________
> Do You Yahoo!?
> Send your FREE holiday greetings online! http://greetings.yahoo.com
>