Re: [Simple-support] Need help adding XML Namespace specification
Brought to you by:
niallg
|
From: Dawid W. <daw...@gm...> - 2012-01-13 07:26:20
|
You really don't need to emit this header as it is exactly the default
every XML processor will have to use. You should emit it if you need
content encoding other than UTF-8; if so, then I would just do:
Writer w = new OutputStreamWriter(outputStream, "UTF-32");
w.write("<?xml encoding=\"UTF-32\" version=\"1.0\" ?>\n");
Persister persister = ...; // initialize to your liking.
persister.write(object, w);
There is also a method accepting an OutputStream and a charset on
Persister, but I don't remember if it emits the prologue (verify if it
does).
Dawid
On Fri, Jan 13, 2012 at 2:05 AM, Sony Ericsson <101...@gm...> wrote:
> Hello
>
> I need to create XML files as below:
>
> <?XML version "1.0"?>
> <fruit>
> <tag1>Apple</tag1>
> <tag2>Orange</tag2>
> </fruit>
>
> I am only having difficulty inserting XML 1.0 Namespace specification
> (highlighted in red). How to do that ? Does SimpleXML support it ?
>
> ------------------------------------------------------------------------------
> RSA(R) Conference 2012
> Mar 27 - Feb 2
> Save $400 by Jan. 27
> Register now!
> http://p.sf.net/sfu/rsa-sfdev2dev2
> _______________________________________________
> Simple-support mailing list
> Sim...@li...
> https://lists.sourceforge.net/lists/listinfo/simple-support
>
|