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 '<' 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><result-set > >row-count='1'><row><l_code01>A1280000</l_code01><la b > >elname>Ξ?Ξ-Ξ£Ξ.ΩΣ > >Ξ>Ξ.ΩΦ.</labelname><streettype>AVE.</streettype><r_e l > >ta>14578</r_elta><length>134.772</length><r_code01& g > >t;A1610000</r_code01><r_code91>A2110100</r_code91><cla s > >s_id>3</class_id><l_code91>A2100800</l_code91><l_el t > >a>14671</l_elta><avenue_id>3</avenue_id></row>&l t > >;/result-set></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 < 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
