users@jaxb.java.net

JAXB and JXPath

From: Aleksei Valikov <valikov_at_gmx.net>
Date: Tue, 04 May 2004 18:34:25 +0200

Hi.

Just wanted to let you know that JAXB works pretty fine with Jakarta Commons JXPath:


final RespParty respParty = (RespParty) unmarshaller.unmarshal(document);
final JXPathContext jxpathContext = JXPathContext.newContext(respParty);

Assert.assertEquals("Wrong value of respPartyRec/rpIndName element.",
jxpathContext.getValue("respPartyRec/rpIndName"), "Scott Tiger");

Assert.assertEquals("Wrong number of roleCode elements.",
jxpathContext.getValue("count(roleCode)"), new Double(2));

Might be helpful for unit testing: comparing results of the same XPath
expression evaluated by JXPath on JAXB objects and by XPathAPI on XML documents.

Bye.
/lexi

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
For additional commands, e-mail: users-help_at_jaxb.dev.java.net