xmlbeans-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kris16 <krister.o.jons...@tietoenator.com>
Subject Re: Missing the XML header
Date Fri, 15 Dec 2006 08:18:57 GMT

Hi,
thanks for the explanation :-)
So before you send away the XML message(what ever transport you are using),
you should always serialize it ?
If you want to send the created XML message via JMS, it is possible to send
it as a String via javax.jms.TextMessage.
But to get the whole XML document, including the header, you need to
serialize it ?

I attached the code for others with this thoughts:
// serialize document
ByteArrayOutputStream result = new ByteArrayOutputStream();
newListItem.save(result);
System.out.println("\nPrint newListItem.save(result);");
System.out.println(result.toString());

System.out.println("\nPrint newListItem.save(System.out);");
newListItem.save(System.out);

/Regards Krister


Eric Vasilik-2 wrote:
> 
> The reason for this is that when saving out chars, the encoding has
> not been established, while when saving out bytes, it has.
> 
> - Eric
> 
> On 12/14/06, Cezar Andrei <cezar@bea.com> wrote:
>> The xml declaration is not used when saving to a text or Writer, but it
>> will be used when saving into an OutputStream.
>>
>> Cezar
>>
>> > -----Original Message-----
>> > From: kris16 [mailto:krister.o.jonsson@tietoenator.com]
>> > Sent: Thursday, December 14, 2006 7:07 AM
>> > To: user@xmlbeans.apache.org
>> > Subject: Missing the XML header
>> >
>> >
>> > Hi,
>> > when i print out my XMK document  the xml header is not shown (<?xml
>> > version="1.0" encoding="UTF-8"?>).
>> > I use the command :
>> >
>> > String xmlStr = newListItem.xmlText(opts);
>> > System.out.println(xmlStr);
>> > The result:
>> >
>> > <ListItemMaster releaseID="test" languageCode="sv"
>> > xmlns="http://www.openapplications.org/oagis/9">
>> >   <ApplicationArea>
>> >     <CreationDateTime>2006-12-14+01:00</CreationDateTime>
>> >   </ApplicationArea>
>> >   <DataArea>
>> >     <List/>
>> >     <ItemMaster/>
>> >   </DataArea>
>> > </ListItemMaster>
>> >
>> >
>> > It prints the whole document but not the first line, <?xml
>> version="1.0"
>> > encoding="UTF-8"?>
>> > Any hints ?
>> >
>> > /Regards Krister
>> >
>> > --
>> > View this message in context: http://www.nabble.com/Missing-the-XML-
>> > header-tf2820453.html#a7872077
>> > Sent from the Xml Beans - User mailing list archive at Nabble.com.
>> >
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
>> > For additional commands, e-mail: user-help@xmlbeans.apache.org
>>
>> _______________________________________________________________________
>> Notice:  This email message, together with any attachments, may contain
>> information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
>> entities,  that may be confidential,  proprietary,  copyrighted  and/or
>> legally privileged, and is intended solely for the use of the individual
>> or entity named in this message. If you are not the intended recipient,
>> and have received this message in error, please immediately return this
>> by email and then delete it.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
>> For additional commands, e-mail: user-help@xmlbeans.apache.org
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
> For additional commands, e-mail: user-help@xmlbeans.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Missing-the-XML-header-tf2820453.html#a7887761
Sent from the Xml Beans - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org


Mime
View raw message