Actually, it should be:

 

“normalize-space(/movie/title)=‘Gladiator’”

 

Or perhaps:

 

“contains(/movie/title, ‘Gladiator’)”

 

Best,

-Rob

 


From: jcplerm [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 25, 2003 7:15 AM
To: xindice-users@xml.apache.org; Boris Rousseau

 

Shouldn't the query be like:?

 

"/movie/title[.='Gladiator']

----- Original Message -----

Sent: Thursday, September 25, 2003 9:10 AM

Subject: Use cases

 

Hi all,

 

I have tried using this XPath search on my XML collection

 

String xpath = "/movie/title='Gladiator'";
XPathQueryService service =
   (XPathQueryService) collection.getService("XPathQueryService", "1.0");
ResourceSet resultSet = service.query(xpath);
ResourceIterator results = resultSet.getIterator();
while (results.hasMoreResources()) {
   XMLResource resource =
      (XMLResource) results.nextResource();
   Node result = resource.getContentAsDOM();
}

 

However, I get several nodes back as the result from the query and only the last one gets in the Node structure, the rest is discarded.

Is there a way around to get all the results in the Node or in a DOM document (maybe using a string)?

 

Regards,

Boris

Reply via email to