Announcement Announcement Module
Collapse
No announcement yet.
How to add the name space prefix to the root element` Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to add the name space prefix to the root element`

    Hi All,
    I have a web -service. The desired response is,
    Code:
    <res:response xmlns:res="uri">
    <res:element1><res:element1>
    <res:element2><res:element1>
    <res:root xmlns:roo=""roouri">
    <roo:child1></roo:child1>
    <roo:child2></roo:child2>
    </res:root>
    </res:response>
    The root element is defined in a different schema and i have imported the namespace correctly.
    The problem I have is, I dont get what I intend to. I get the following,
    Code:
    <res:response xmlns:res="uri">
    <res:element1><res:element1>
    <res:element2><res:element1>
    <res:root >
    <roo:child1 xmlns:roo=""roouri"></roo:child1>
    <roo:child2 xmlns:roo=""roouri"></roo:child2>
    </res:root>
    </res:response>
    I do not want the child elements to have the xmlns tag. Is there a way to acheive this in Spring?
    Btw, I use Castor Marshalling.


    Thanks,
    Paary

  • #2
    Any one who could help me?Stuck for some time now

    Comment


    • #3
      This seems to be a Castor issue, but in general I would say that the two XML snippets you posted are semantically equivalent, so there shouldn't be a problem.

      Comment

      Working...
      X