You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by "Pike, Gordon" <Go...@McKesson.com> on 2008/11/06 17:52:46 UTC

JXPATH - How to search for an attribute value that has a ":" in it?

I have been trying to select objects with an attribute @beanIdentity
that has a colon in it. I've tried escaping the colon but that doesn't
work either. When I use another field (like the commented out createdBy
field) I get results. Is there a way to search with string that has a
":" in it? I've tried escaping the colon but that didn't work either.
 
 
JXPathContext context = JXPathContext.newContext(container);

//String xpath = "ipcList[@createdBy = 'KUCZUN, LAURIE ']";

String xpath = "ipcList[@beanIdentity =
'com.mckesson.hcs.poc.author.domain.Ipc:com.mckesson.hcs.poc.author.doma
in.Ipc#62808']";

//String xpath = "ipcList[@beanIdentity =
'com.mckesson.hcs.poc.author.domain.Ipc&#58;com.mckesson.hcs.poc.author.
domain.Ipc#62808']";

Iterator i = context.iterate(xpath);

while(i.hasNext()) {

IpcV ipc = (IpcV) i.next();

log.debug("Ipc " + ipc.getBeanIdentity());

}

 

Gordon Pike

Tech Lead, Horizon Expert Plan

McKesson Provider Technologies