Steven,
 
I think the reason is that your XML file contains namespace declarations.
 
But to be sure: could you send us a sample of your XML file and some sample code illustrating your problem
 
regards,
Maarten

Steven Citron-Pousty <[EMAIL PROTECTED]> wrote:

I am using dom4j 1.6 with jaxen 1-1 beta 6 but I also tried this with beta 4.

In my old code I could use xpath syntax like this

List list = root.selectNodes( "//SellerId" );

And I would get all the SellerID nodes.

I tried that with the new dom4j code and I kept getting an empty list.

I had dom4j tell me the xpath for the root node and it said the syntax has to look like this:

/*[name()='ItemLookupResponse']

So my code above became this:

List list = root.selectNodes( "//*[name()='SellerId']" );

 

Which now gives me a list of 9 objects.

Both xpath syntax styles work in xmlSpy but my original style is much cleaner. Why did the style change or why doesn’t the first style work anymore? I noticed that the tests use the old style (in the zip I downloaded for 1.6) and all the tests pass according to the maven doc.

How is this the case?

 

Most importantly, if the second style is the only working style, someone has to update all the examples since they use the style of the first syntax.

Thanks,

Steve


Discover Yahoo!
Find restaurants, movies, travel & more fun for the weekend. Check it out!

Reply via email to