users@jaxb.java.net

Re: marshalling

From: Wolfgang Laun <wolfgang.laun_at_gmail.com>
Date: Thu, 25 Jun 2009 16:38:15 +0200

On 6/25/09, Lulseged Zerfu <lulseged.zerfu_at_ericsson.com> wrote:
> Hi
>
> When marshalling an xml document I get the following xml document:
> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>

[snip]
>
> 1. How can I get ride of standalone="yes"?

marshaller.setProperty(Marshaller.JAXB_FRAGMENT, Boolean.TRUE);

Write the <?xml...> as you want to the writer of your XML.

marshaller.marshal(...)

-W


> 2. How can I put the name space declaration
> xmlns:pr="urn:ietf:params:xml:ns:pres-rules" on top like the
> xmlns:cr="urn:ietf:params:xml:ns:common-policy declaration is?
>

I think that this has been asked before, but it seems it can't be done.

-W


> Thanks as always.
>
> Lulseged
>
>