Re: [Wbxmllib-devel] CDATA encoded into opaque
Rasmus Lock Larsen <[email protected]> Wed, 24 Aug 2005 15:25:03 +0200
| Newsgroups | gmane.comp.gnome.apps.multisync.devel |
|---|---|
| Message-ID | <[email protected]> |
------=_Part_2576_5207596.1124889903475 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Yes. The OPAQUE is included in the WBXML to allow for application specific=20 optimisations, e.g. transporting binary data. There is no "general" definition of how to interpret OPAQUE data, it is=20 ALWAYS application specific. You are how-ever right in saying that from an application point of view it= =20 MAY be possible to say that OPAQUE is in CDATA, but often it is not that=20 simple. E.g. for SyncML 1.2 the Meta tag is used to indicate the content stored in= =20 the data field <Meta><Format>b64</Format></Meta> <Data>...b64-data...</Data> Here the Data tag MAY be encoded using the OPAQUE field, provided that the= =20 Meta/Format tag is changed accordingly, so if the Data element is coded as= =20 OPAQUE (meaning the data becomes base64-decoded), the value of the Format= =20 element MUST be changed to "bin" instead of "b64". Such "local" specifications can apply for every application (content-type)= . Reg. the 3rd paragraph: It was more of a "implementation" specific=20 suggestion to implement logic on the end-application (meaning AFTER the=20 WBXML encoder/decoder) instead of doing business logic directly on the WBXM= L=20 content (since a simple string can be encoded in many ways). In general, many applications (at least SyncML DM) uses OPAQUE to code=20 strings (where they just as well could've used STR_I). So to tie the OPAQUE= =20 to CDATA would not be a portable solution. BR. Rasmus On 8/24/05, Philippe Laporte <[email protected]> wrote:=20 >=20 > Hi, > Thanks for your answer. Yes, libwbxml will report CDATA as text. >=20 > Yes, an XML file can be converted in many different ways into an WBXML > document, when it comes to inlining strings or referencing the string > the string table, but these are all standardized, and hence deterministic= . >=20 > The decoder can handle the different encodings because they are valid > with respect to the WBXML specs. What is not deterministic is if the > decoder sees OPAQUE, what's in it. >=20 > Or? >=20 > I don't quite get the third paragraph. Do you mean the WBXML OPAQUE=20 > content? >=20 > Really there should be standardized way of determining what is the > OPAQUE...no? One could say, for example, if the WBXML is SyncML, then > the OPAQUE is CDATA, no? >=20 > Best Regards, >=20 > Philippe Laporte > Software >=20 > Gatespace Telematics > F=F6rsta L=E5nggatan 18 > 41328 G=F6teborg > Sweden > Phone: +46 702 04 35 11 > Fax: +46 31 24 16 50 > Email: philippe.laporte-FIFhI/qTGH1saXRJfIyQzzlRY1/[email protected] >=20 >=20 >=20 > Rasmus Lock Larsen wrote: >=20 > > I see your point. Actually, the wbxmllib will not decode an WBXML > > document encoded from an XML containing CDATA into the same XML (since > > the CDATA tags are not added when decoding OPAQUE WBXML). > > > > My key-point is, that you CAN'T ensure interoperability when talking > > about WBXML (since there is an almost unlimited number of WBXML > > documents representing the same XML document), so as long as your > > decoder can handle the different combinations of encodings, the > > interoperability should be ensured (in XML that is). > > > > Never write any logic (except in the decoder) that uses the WBXML > > content, since the WBXML content is so ambiguous, you will most likely > > increase the code-complexity and still not have a 100% > > interoperability coverage. > > > > Br. Rasmus > > > > On 8/22/05, *Philippe Laporte* > > <philippe.laporte-FIFhI/qTGH1saXRJfIyQzzlRY1/[email protected] > > <mailto:philippe.laporte-FIFhI/qTGH1saXRJfIyQzzlRY1/[email protected]>> wrote: > > > > Hi, > > Thanks for your answer. > > > > My question is about how to ensure interoperability between different > > WBXML servers and clients when it comes to encoding of CDATA. > > > > Thanks a lot, > > > > Philippe Laporte > > Software > > > > Gatespace Telematics > > F=F6rsta L=E5nggatan 18 > > 41328 G=F6teborg > > Sweden > > Phone: +46 702 04 35 11 > > Fax: +46 31 24 16 50 > > Email: philippe.laporte-FIFhI/qTGH1saXRJfIyQzzlRY1/[email protected] > > <mailto:philippe.laporte-FIFhI/qTGH1saXRJfIyQzzlRY1/[email protected]> > > > > > > > > Philippe Laporte wrote: > > > > > Hi, > > > Looking at the code in libwbxml it appears that CDATAs are > > encoded > > > into opaque for WBXML. > > > > > > I couldn't find the section in the WBXML specification document that > > > specifies this. > > > > > > Is it specified at all, or is it in any way standardized to do > > this? > > > > > > Similar question for not encoding in <![CDATA[ and ]]> > > > (although of course it makes a lot of sense). > > > > > > So the complementary question is what is the heuristics for knowing > > > what's in an OPAQUE section? > > > > > > Thanks, > > > Philippe > > > > > > > > > ------------------------------------------------------- > > > SF.Net email is Sponsored by the Better Software Conference & EXPO > > > September 19-22, 2005 * San Francisco, CA * Development Lifecycle > > > Practices > > > Agile & Plan-Driven Development * Managing Projects & Teams * > > Testing > > > & QA > > > Security * Process Improvement & Measurement * > > http://www.sqe.com/bsce5sf > > > _______________________________________________ > > > Wbxmllib-devel mailing list > > > [email protected] > > <mailto:[email protected]> > > > https://lists.sourceforge.net/lists/listinfo/wbxmllib-devel > > > > > > > > ------------------------------------------------------- > > SF.Net email is Sponsored by the Better Software Conference & EXPO > > September 19-22, 2005 * San Francisco, CA * Development Lifecycle > > Practices > > Agile & Plan-Driven Development * Managing Projects & Teams * > > Testing & QA > > Security * Process Improvement & Measurement * > > http://www.sqe.com/bsce5sf > > _______________________________________________ > > Wbxmllib-devel mailing list > > [email protected] > > <mailto:[email protected]> > > https://lists.sourceforge.net/lists/listinfo/wbxmllib-devel > > > > > > > > > > -- > > Med venlig hilsen / Best regards > > Rasmus Lock Larsen > > [email protected] <mailto:[email protected]> >=20 >=20 --=20 Med venlig hilsen / Best regards Rasmus Lock Larsen [email protected] ------=_Part_2576_5207596.1124889903475 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline <div>Yes.</div> <div> </div> <div>The OPAQUE is included in the WBXML to allow for application specific = optimisations, e.g. transporting binary data.</div> <div> </div> <div>There is no "general" definition of how to interpret OPAQUE = data, it is ALWAYS application specific.</div> <div> </div> <div>You are how-ever right in saying that from an application point of vie= w it MAY be possible to say that OPAQUE is in CDATA, but often it is not th= at simple.</div> <div> </div> <div>E.g. for SyncML 1.2 the Meta tag is used to indicate the content store= d in the data field</div> <div> </div> <div><Meta><Format>b64</Format></Meta></div> <div><Data>...b64-data...</Data></div> <div> </div> <div>Here the Data tag MAY be encoded using the OPAQUE field, provided that= the Meta/Format tag is changed accordingly, so if the Data element is code= d as OPAQUE (meaning the data becomes base64-decoded), the value of the For= mat element MUST be changed to "bin" instead of "b64". </div> <div> </div> <div>Such "local" specifications can apply for every application = (content-type).</div> <div> </div> <div>Reg. the 3rd paragraph: It was more of a "implementation" sp= ecific suggestion to implement logic on the end-application (meaning A= FTER the WBXML encoder/decoder) instead of doing business logic directly on= the WBXML content (since a simple string can be encoded in many ways). <br> </div> <div>In general, many applications (at least SyncML DM) uses OPAQUE to code= strings (where they just as well could've used STR_I). So to tie the OPAQU= E to CDATA would not be a portable solution.</div> <div> </div> <div>BR. Rasmus<br> </div> <div><span class=3D"gmail_quote">On 8/24/05, <b class=3D"gmail_sendername">= Philippe Laporte</b> <<a href=3D"mailto:[email protected]">ph_= [email protected]</a>> wrote:</span> <blockquote class=3D"gmail_quote" style=3D"PADDING-LEFT: 1ex; MARGIN: 0px 0= px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Hi,<br> Thanks for y= our answer. Yes, libwbxml will report CDATA as text.<br><br>Yes, an XML fil= e can be converted in many different ways into an WBXML <br>document, when it comes to inlining strings or referencing the string<b= r>the string table, but these are all standardized, and hence deterministic= .<br><br>The decoder can handle the different encodings because they are va= lid <br>with respect to the WBXML specs. What is not deterministic is if the<br= >decoder sees OPAQUE, what's in it.<br><br>Or?<br><br>I don't quite get the= third paragraph. Do you mean the WBXML OPAQUE content?<br><br>Really there= should be standardized way of determining what is the <br>OPAQUE...no? One could say, for example, if the WBXML is SyncML, then<b= r>the OPAQUE is CDATA, no?<br><br>Best Regards,<br><br>Philippe Laporte<br>= Software<br><br>Gatespace Telematics<br>F=F6rsta L=E5nggatan 18<br>41328 G= =F6teborg <br>Sweden<br>Phone: +46 702 04 35 11<br>Fax: +46 31 24 16 50<b= r>Email: <a href=3D"mailto:philippe.laporte-FIFhI/qTGH1saXRJfIyQzzlRY1/[email protected]">philip= pe.laporte-FIFhI/qTGH1saXRJfIyQzzlRY1/[email protected]</a><br><br><br><br>Rasmus Lock Larsen wr= ote:<br> <br>> I see your point. Actually, the wbxmllib will not decode an WBXML<= br>> document encoded from an XML containing CDATA into the same XML (si= nce<br>> the CDATA tags are not added when decoding OPAQUE WBXML).<br> ><br>> My key-point is, that you CAN'T ensure interoperability when t= alking<br>> about WBXML (since there is an almost unlimited number of WB= XML<br>> documents representing the same XML document), so as long as yo= ur <br>> decoder can handle the different combinations of encodings, the<br= >> interoperability should be ensured (in XML that is).<br>><br>> = Never write any logic (except in the decoder) that uses the WBXML<br>> c= ontent, since the WBXML content is so ambiguous, you will most likely <br>> increase the code-complexity and still not have a 100%<br>> int= eroperability coverage.<br>><br>> Br. Rasmus<br>><br>> On 8/22/= 05, *Philippe Laporte*<br>> <<a href=3D"mailto:philippe.laporte@gates= pacetelematics.com"> philippe.laporte-FIFhI/qTGH1saXRJfIyQzzlRY1/[email protected]</a><br>> <mailto:<a href=3D"= mailto:philippe.laporte-FIFhI/qTGH1saXRJfIyQzzlRY1/[email protected]">philippe.laporte@gatespace= telematics.com</a>>> wrote:<br>><br>> H= i,<br>> Thanks for your = answer. <br>><br>> My question is about how to ensure= interoperability between different<br>> WBXML s= ervers and clients when it comes to encoding of CDATA.<br>><br>> = ; Thanks a lot,<br>><br>> P= hilippe Laporte <br>> Software<br>><br>> = Gatespace Telematics<br>> F=F6rsta L=E5ng= gatan 18<br>> 41328 G=F6teborg<br>> &nbs= p; Sweden<br>> Phone: +46 702 04 35 = 11<br>> Fax: +46 31 24 16 50<br>>= Email:=20 <a href=3D"mailto:philippe.laporte-FIFhI/qTGH1saXRJfIyQzzlRY1/[email protected]">philippe.laport= [email protected]</a><br>> <mailto:<a= href=3D"mailto:philippe.laporte-FIFhI/qTGH1saXRJfIyQzzlRY1/[email protected]">philippe.laporte@= gatespacetelematics.com </a>><br>><br>><br>><br>> Philippe L= aporte wrote:<br>><br>> > Hi,<br>> = ; > Looking at the code in libw= bxml it appears that CDATAs are<br>> encoded<br>= > > into opaque for WBXML. <br>> ><br>> > = I couldn't find the section in the WBXML specification document that<br>>= ; > specifies this.<br>> &nb= sp; ><br>> > Is it specified at all, or is= it in any way standardized to do <br>> this?<br>> >= <br>> > Similar question for not encoding in&= nbsp; <![CDATA[ and &= nbsp; ]]><br>> > (although of course= it makes a lot of sense).<br>> ><br>>&nbs= p; > So the complementary question is what is the heur= istics for knowing <br>> > what's in an OPAQUE section?<br>>&= nbsp; ><br>> > Thanks,<b= r>> > Philippe<br>>  = ; ><br>> ><br>> = > ------------------------------------------------------- <br>> > SF.Net email is Sponsored by the Bett= er Software Conference & EXPO<br>> > Sept= ember 19-22, 2005 * San Francisco, CA * Development Lifecycle<br>> = > Practices<br>> > Agil= e & Plan-Driven Development * Managing Projects & Teams * <br>> Testing<br>> &g= t; & QA<br>> > Security * Process Improve= ment & Measurement *<br>> <a href=3D"http://= www.sqe.com/bsce5sf">http://www.sqe.com/bsce5sf</a><br>> &nbs= p; > _______________________________________________ <br>> > Wbxmllib-devel mailing list<br>>&n= bsp; > <a href=3D"mailto:[email protected]= rge.net">[email protected]</a><br>> = <mailto:<a href=3D"mailto:[email protected]"> [email protected]</a>><br>>  = ; > <a href=3D"https://lists.sourceforge.net/lists/listinfo/wbxmllib-dev= el">https://lists.sourceforge.net/lists/listinfo/wbxmllib-devel</a><br>>= <br>><br>><br> > ----------------------------------------------= ---------<br>> SF.Net email is Sponsored by the = Better Software Conference & EXPO<br>> Septe= mber 19-22, 2005 * San Francisco, CA * Development Lifecycle <br>> Practices<br>> = Agile & Plan-Driven Development * Managing Projects & Teams *<br>&g= t; Testing & QA<br>> = Security * Process Improvement & Measurement *<br>> &nbs= p; <a href=3D"http://www.sqe.com/bsce5sf"> http://www.sqe.com/bsce5sf</a><br>> ____________= ___________________________________<br>> Wbxmlli= b-devel mailing list<br>> <a href=3D"mailto:Wbxm= [email protected]">[email protected] </a><br>> <mailto:<a href=3D"mailto:Wbxmllib-= [email protected]">[email protected]</a>><b= r>> <a href=3D"https://lists.sourceforge.net/lis= ts/listinfo/wbxmllib-devel">https://lists.sourceforge.net/lists/listinfo/wb= xmllib-devel </a><br>><br>><br>><br>><br>> --<br>> Med venlig hilsen /= Best regards<br>> Rasmus Lock Larsen<br>> <a href=3D"mailto:rasmus.l= [email protected]">[email protected]</a> <mailto:<a href= =3D"mailto:[email protected]"> [email protected]</a>><br><br></blockquote></div><br><br clea= r=3D"all"><br>-- <br>Med venlig hilsen / Best regards<br>Rasmus Lock Larsen= <br><a href=3D"mailto:[email protected]">rasmus.lock.larsen@gmai= l.com </a>=20 ------=_Part_2576_5207596.1124889903475-- ------------------------------------------------------- SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf