This is by design, take a peek at the javadoc.
http://xmlbeans.apache.org/docs/2.4.0/reference/org/apache/xmlbeans/XmlTokenSource.html#xmlText(org.apache.xmlbeans.XmlOptions)
xmlText

String <http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html>
*xmlText*(XmlOptions
<http://xmlbeans.apache.org/docs/2.4.0/reference/org/apache/xmlbeans/XmlOptions.html>
options)

Just like xmlText() but with options. Options map may be null.

Note that this method does not produce XML with the XML declaration,
including the encoding information. To save the XML declaration with the
XML, see 
save(OutputStream)<http://xmlbeans.apache.org/docs/2.4.0/reference/org/apache/xmlbeans/XmlTokenSource.html#save%28java.io.OutputStream%29>or
save(OutputStream,
XmlOptions)<http://xmlbeans.apache.org/docs/2.4.0/reference/org/apache/xmlbeans/XmlTokenSource.html#save%28java.io.OutputStream,%20org.apache.xmlbeans.XmlOptions%29>.

HTH,
-jacobd

On Fri, Sep 25, 2009 at 1:13 AM, Nick de Graeve <nick.degra...@telenet.be>wrote:

> When I save my XMLBean to disk I get a slightly different result from when
> I do a toString() or xmlText().
> The formatting and contents are the same but the file on disk starts with
>
> <?xml version="1.0" encoding="UTF-8"?>
>
> while the string does not.
>
> How can I make sure both are exactly the same?
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org
> For additional commands, e-mail: user-h...@xmlbeans.apache.org
>
>

Reply via email to