This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Strange behaviour with CachedXPathAPI

 
Jag Bains
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have a strange problem when using CachedXPathAPI.selectNodeList(node, nodeName);
If the nodename is replace with a string literal e.g


or with a variable name that uses a literal e.g

Then the nodelist is retured perfectly fine.
However, if the nodeName comes from a hashMap e.g.

then I get the following exception:


Has anyone got any ideas why this is happening or how I can get around it?
Thanks
Jag
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jag,
If you add a debug statement showing the value of your string (coming from the hashmap), you may discover that the problem is not with the XPathAPI but rather with the value you assign to the "NODENAME" key.
Regards
 
Jag Bains
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes you are right. The value in my hashmap actually had " a round the text.
Stupid me.
Jag
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic