commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pike, Gordon" <Gordon.P...@McKesson.com>
Subject JXPATH - How to search for an attribute value that has a ":" in it?
Date Thu, 06 Nov 2008 16:52:46 GMT
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 

 

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message