Awesome! The Binder is exactly what I need - many thanks!
James
Aleksei Valikov wrote:
>
> Hi.
>
>> I've a simple JAXB POJO for XPath expressions I'm marshalling in Apache
>> Camel
>> like this...
>>
>> <xpath>/foo/bar</xpath>
>>
>> What I'd like to do is inject the XPath POJO with the XML namespaces
>> available at the <xpath> element so that the namespace prefixes can be
>> used
>> inside the XPath expression. e.g.
>>
>> <foo xmlns:x="cheese">
>> <xpath>/x:foo</xpath>
>> </foo>
>>
>> I've had a little look around the JAXB API and I don't see any way to
>> kinda
>> grab the namespace context; any one got any neat ideas?
>>
>> Note this is only an issue for parsing.
>
> Check out the binder API. You could maintain DOM and unmarshalled
> objects in parallel and refer to DOM for things that are not mapped -
> like namespace declarations, comments, processing instructions etc.
>
> Another ide would be to put a SAX filter between XML and JAXB
> unmarshaller and gather NS declarations there.
>
> 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
>
>
>
--
View this message in context: http://www.nabble.com/Whats-the-easiest-way-to-find-the-namespace-context-at-the-point-on-which-a-POJO-is-instantiated--tf4609619.html#a13169955
Sent from the java.net - jaxb users mailing list archive at Nabble.com.