Unfortunately JXPath/JAXB can't be expected to behave same way as
XPathAPI/DOM except for very small subset of possible xml documents.
It would be very nice if future version of JAXB embeds enough metadata
with generated classes to allow real xpath implementation.
Thanks
-gia
> -----Original Message-----
> From: Aleksei Valikov [mailto:valikov_at_gmx.net]
> Sent: Tuesday, May 04, 2004 9:34 AM
> To: users_at_jaxb.dev.java.net
> Subject: JAXB and JXPath
>
> 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
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
For additional commands, e-mail: users-help_at_jaxb.dev.java.net