Actually, the XmlResultSet class provides the two static methods for
marshalling/unmarshalling the contained data to/from xml.
I've set that in the JiBX binding definition, and that's the result I get.
However, I do create the xml as a plain string ... do you think I should
try to set the encoding rather than just writting out the data into a string
?

Cheers,
Angel
O:]

P.S. .. boy is it HOT in the sea here in Greece !!! :D I  must look like
Sandra Bullock in "the Net" right now, with a laptop having cold coffee by
the shore ... if only she was here too ! ;D




----- Original Message ----- 
From: "Dennis Sosnoski" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, August 13, 2004 12:59 AM
Subject: Re: [jibx-users] Possible Encoding issue ?


> You can't just write XML as text into a document being marshalled...
> well, actually you can, by getting the XMLWriter from the marshalling
> context and using the writeContent method - but it's not recommended
> unless you really know what you're doing. If you really want to generate
> your own XML fragment to be embedded in a marshalled document
> getXMLWriter() and writeContent() is the way to go. This will also
> handle the character encoding issues, converting to the proper character
> encoding as set on your document.
>
> But be aware that if you violate the rules of XML (which you can easily
> do, using this method) you won't be able to read the document back in
> again at all. Those rules include replacing '<' with '&lt;' within
> character data content, which is why you see that done to the data you
> wrote.
>
> The better way of handling this is with a custom marshaller/unmarshaller
> for your XmlResultSet, where you can work at the level of elements,
> attributes, and character data, and JiBX will handle the XML details for
> you. That way you'll be able to unmarshal the data back to objects, too,
> while if you just write it out there's no way for JiBX to unmarshal it
> for you.
>
>   - Dennis
>
> Άγγελος Καράντζαλης wrote:
>
> >Would that explain this ?
> >
> ><?xml version="1.0" encoding="UTF-8"?>
> ><dresp-message>
> >
<class-name>gr.talent.messaging.message.DataResponseMessage</class-name>
> >    <user-hash/>
> >    <data>&lt;result-set
>
>row-count='1'&gt;&lt;row&gt;&lt;l_code01&gt;A1280000&lt;/l_code01&gt;&lt;la
b
> >elname&gt;Ξ?Ξ-Ξ£Ξ.ΩΣ
>
>Ξ>Ξ.ΩΦ.&lt;/labelname&gt;&lt;streettype&gt;AVE.&lt;/streettype&gt;&lt;r_e
l
>
>ta&gt;14578&lt;/r_elta&gt;&lt;length&gt;134.772&lt;/length&gt;&lt;r_code01&
g
>
>t;A1610000&lt;/r_code01&gt;&lt;r_code91&gt;A2110100&lt;/r_code91&gt;&lt;cla
s
>
>s_id&gt;3&lt;/class_id&gt;&lt;l_code91&gt;A2100800&lt;/l_code91&gt;&lt;l_el
t
>
>a&gt;14671&lt;/l_elta&gt;&lt;avenue_id&gt;3&lt;/avenue_id&gt;&lt;/row&gt;&l
t
> >;/result-set&gt;</data>
> >    <recordCount>1</recordCount>
> ></dresp-message>
> >
> >.. within the DataResponseMessage class - which is marshalled using
JiBX -
> >there is an XmlResultSet class which I serialize myself, but I've set my
> >encoding to be the Greek character set. Would that explain the &lt;
instead
> >of  "<" etc. and the garbled Greek string values in the xml ?
> >
> >Thanks again,
> >Angel
> >O:]
> >
> >
> >----- Original Message ----- 
> >From: "Dennis Sosnoski" <[EMAIL PROTECTED]>
> >To: <[EMAIL PROTECTED]>
> >Sent: Wednesday, August 11, 2004 7:34 PM
> >Subject: Re: [jibx-users] Possible Encoding issue ?
> >
> >
> >
> >
> >>This could certainly be a problem if you're working with streams. Even
> >>if your XML fragments are well-formed documents (basically just a single
> >>element, with children), if your character encoding is something other
> >>than UTF-8 it won't be recognized unless you either specify the encoding
> >>when you supply the input stream to the unmarshaller or add an XML
> >>declaration to the start of the fragment that gives the encoding.
> >>
> >>  - Dennis
> >>
> >>Άγγελος Καράντζαλης wrote:
> >>
> >>
> >>
> >>>Is there a possibility that JiBX will fail to unmarshall the xml if a
> >>>
> >>>
> >weird
> >
> >
> >>>encoding is used ? For instance, I try to umarshall an xml fragment
that
> >>>might contain Greek characters. During Unmarshalling I get an exception
> >>>
> >>>
> >with
> >
> >
> >>>message:
> >>>Error on line 1: The markup in the document preceding the root element
> >>>
> >>>
> >must
> >
> >
> >>>be well-formed.
> >>>
> >>>Cheers,
> >>>
> >>>Angel
> >>>O:]
> >>>
> >>>
> >>>
> >>>
>
>
> -------------------------------------------------------
> SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
> 100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
> Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
> http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
> _______________________________________________
> jibx-users mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jibx-users
>
>




-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
_______________________________________________
jibx-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jibx-users
  • ... Άγγελος Καράντζαλης
    • ... Dennis Sosnoski
      • ... Άγγελος Καράντζαλης
        • ... Dennis Sosnoski
          • ... Tilman Linden
          • Άγγελος Καράντζαλης

Reply via email to