Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Namespace problem while creating org.jdom.xpath expression

843834May 20 2005 — edited Jul 20 2005
Hi All.

I'm trying to search an element in the xml using selectSingleNode() function of org.jdom.xpath. The function returns me null and I'm sure that I'm not building the xpath expression correctly. Below is an example of my XML:
<?xml version = "1.0" encoding = "UTF-8"?> 
<ContainerBatch xmlns= "http://xmlns.example.com/unique/default/namespace/10012"> 
        
   <Batches>
	<BatchData xmlns = "http://xmlns.example.com/unique/default/namespace/1001">
	</BatchData>
   </Batches>
   <Containers> 
     <ContainerData xmlns="http://xmlns.example.com/unique/default/namespace/1002"> 
         <ContainerItems> 
           <Item>                          
	     <BatchID>10200-1</BatchID> 
           </Item> 
           <Item>                          
	    <BatchID>10200-1</BatchID> 
           </Item>
         </ContainerItems>
What expression should I give in order to search BatchID of the second Item?

Many thanks in advance for your responses.
Regards,
Ashwani
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 17 2005
Added on May 20 2005
8 comments
332 views