Search code examples
javajaxbapache-cameldozer

Getting the namespace name from JMS message


I'm using Apache camel JMS, jaxb and dozer mapping. I need an approach to get the namespace attribute name

For instance

<webrequest xmlns:service = "http:xxx/yyy/">

...

Need to grab the term service from this JMS message. Suggestions please.


Solution

  • Your question is very unclear (for example in what context you need to get the namespace value with what technology), you should check out the How-to about asking questions.

    However, I give it a try to answer without any details. In general you can select the value with XPath

    XPath 2.0

    /webrequest/namespace-uri-for-prefix('service',.)
    

    XPath 1.0

    /webrequest/namespace::service