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>&nbsp;</div>
<div>The OPAQUE is included in the WBXML to allow for application specific =
optimisations, e.g. transporting binary data.</div>
<div>&nbsp;</div>
<div>There is no &quot;general&quot; definition of how to interpret OPAQUE =
data, it is ALWAYS application specific.</div>
<div>&nbsp;</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>&nbsp;</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>&nbsp;</div>
<div>&lt;Meta&gt;&lt;Format&gt;b64&lt;/Format&gt;&lt;/Meta&gt;</div>
<div>&lt;Data&gt;...b64-data...&lt;/Data&gt;</div>
<div>&nbsp;</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 &quot;bin&quot; instead of &quot;b64&quot;.
</div>
<div>&nbsp;</div>
<div>Such &quot;local&quot; specifications can apply for every application =
(content-type).</div>
<div>&nbsp;</div>
<div>Reg. the 3rd paragraph: It was more of a &quot;implementation&quot; sp=
ecific suggestion&nbsp;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>&nbsp;</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>&nbsp;</div>
<div>BR. Rasmus<br>&nbsp;</div>
<div><span class=3D"gmail_quote">On 8/24/05, <b class=3D"gmail_sendername">=
Philippe Laporte</b> &lt;<a href=3D"mailto:[email protected]">ph_=
[email protected]</a>&gt; 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>&nbsp;&nbsp; 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:&nbsp;&nbsp; +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>&gt; I see your point. Actually, the wbxmllib will not decode an WBXML<=
br>&gt; document encoded from an XML containing CDATA into the same XML (si=
nce<br>&gt; the CDATA tags are not added when decoding OPAQUE WBXML).<br>
&gt;<br>&gt; My key-point is, that you CAN'T ensure interoperability when t=
alking<br>&gt; about WBXML (since there is an almost unlimited number of WB=
XML<br>&gt; documents representing the same XML document), so as long as yo=
ur
<br>&gt; decoder can handle the different combinations of encodings, the<br=
>&gt; interoperability should be ensured (in XML that is).<br>&gt;<br>&gt; =
Never write any logic (except in the decoder) that uses the WBXML<br>&gt; c=
ontent, since the WBXML content is so ambiguous, you will most likely
<br>&gt; increase the code-complexity and still not have a 100%<br>&gt; int=
eroperability coverage.<br>&gt;<br>&gt; Br. Rasmus<br>&gt;<br>&gt; On 8/22/=
05, *Philippe Laporte*<br>&gt; &lt;<a href=3D"mailto:philippe.laporte@gates=
pacetelematics.com">
philippe.laporte-FIFhI/qTGH1saXRJfIyQzzlRY1/[email protected]</a><br>&gt; &lt;mailto:<a href=3D"=
mailto:philippe.laporte-FIFhI/qTGH1saXRJfIyQzzlRY1/[email protected]">philippe.laporte@gatespace=
telematics.com</a>&gt;&gt; wrote:<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; H=
i,<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Thanks for your =
answer.
<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; My question is about how to ensure=
 interoperability between different<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; WBXML s=
ervers and clients when it comes to encoding of CDATA.<br>&gt;<br>&gt;&nbsp=
;&nbsp;&nbsp;&nbsp; Thanks a lot,<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; P=
hilippe Laporte
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; Software<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;=
&nbsp; Gatespace Telematics<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; F=F6rsta L=E5ng=
gatan 18<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; 41328 G=F6teborg<br>&gt;&nbsp;&nbs=
p;&nbsp;&nbsp; Sweden<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; Phone: +46 702 04 35 =
11<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; Fax:&nbsp;&nbsp; +46 31 24 16 50<br>&gt;=
&nbsp;&nbsp;&nbsp;&nbsp; Email:=20
<a href=3D"mailto:philippe.laporte-FIFhI/qTGH1saXRJfIyQzzlRY1/[email protected]">philippe.laport=
[email protected]</a><br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &lt;mailto:<a=
 href=3D"mailto:philippe.laporte-FIFhI/qTGH1saXRJfIyQzzlRY1/[email protected]">philippe.laporte@=
gatespacetelematics.com
</a>&gt;<br>&gt;<br>&gt;<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; Philippe L=
aporte wrote:<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; Hi,<br>&gt;&nbsp=
;&nbsp;&nbsp;&nbsp; &gt;&nbsp;&nbsp;&nbsp;&nbsp;Looking at the code in libw=
bxml it appears that CDATAs are<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; encoded<br>=
&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; into opaque for WBXML.
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; =
I couldn't find the section in the WBXML specification document that<br>&gt=
;&nbsp;&nbsp;&nbsp;&nbsp; &gt; specifies this.<br>&gt;&nbsp;&nbsp;&nbsp;&nb=
sp; &gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; Is it specified at all, or is=
 it in any way standardized to do
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; this?<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt;=
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; Similar question for not encoding in&=
nbsp;&nbsp;&nbsp;&nbsp;&lt;![CDATA[&nbsp;&nbsp;&nbsp;&nbsp;and&nbsp;&nbsp;&=
nbsp;&nbsp; ]]&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; (although of course=
 it makes a lot of sense).<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt;<br>&gt;&nbs=
p;&nbsp;&nbsp;&nbsp; &gt; So the complementary question is what is the heur=
istics for knowing
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; what's in an OPAQUE section?<br>&gt;&=
nbsp;&nbsp;&nbsp;&nbsp; &gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; Thanks,<b=
r>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; Philippe<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp=
; &gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;=
 &gt; -------------------------------------------------------
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; SF.Net email is Sponsored by the Bett=
er Software Conference &amp; EXPO<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; Sept=
ember 19-22, 2005 * San Francisco, CA * Development Lifecycle<br>&gt;&nbsp;=
&nbsp;&nbsp;&nbsp; &gt; Practices<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; Agil=
e &amp; Plan-Driven Development * Managing Projects &amp; Teams *
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; Testing<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &g=
t; &amp; QA<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; Security * Process Improve=
ment &amp; Measurement *<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; <a href=3D"http://=
www.sqe.com/bsce5sf">http://www.sqe.com/bsce5sf</a><br>&gt;&nbsp;&nbsp;&nbs=
p;&nbsp; &gt; _______________________________________________
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; Wbxmllib-devel mailing list<br>&gt;&n=
bsp;&nbsp;&nbsp;&nbsp; &gt; <a href=3D"mailto:[email protected]=
rge.net">[email protected]</a><br>&gt;&nbsp;&nbsp;&nbsp;=
&nbsp; &lt;mailto:<a href=3D"mailto:[email protected]">
[email protected]</a>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp=
; &gt; <a href=3D"https://lists.sourceforge.net/lists/listinfo/wbxmllib-dev=
el">https://lists.sourceforge.net/lists/listinfo/wbxmllib-devel</a><br>&gt;=
<br>&gt;<br>&gt;<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; ----------------------------------------------=
---------<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; SF.Net email is Sponsored by the =
Better Software Conference &amp; EXPO<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; Septe=
mber 19-22, 2005 * San Francisco, CA * Development Lifecycle
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; Practices<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; =
Agile &amp; Plan-Driven Development * Managing Projects &amp; Teams *<br>&g=
t;&nbsp;&nbsp;&nbsp;&nbsp; Testing &amp; QA<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;=
 Security * Process Improvement &amp; Measurement *<br>&gt;&nbsp;&nbsp;&nbs=
p;&nbsp; <a href=3D"http://www.sqe.com/bsce5sf">
http://www.sqe.com/bsce5sf</a><br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; ____________=
___________________________________<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; Wbxmlli=
b-devel mailing list<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; <a href=3D"mailto:Wbxm=
[email protected]">[email protected]
</a><br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &lt;mailto:<a href=3D"mailto:Wbxmllib-=
[email protected]">[email protected]</a>&gt;<b=
r>&gt;&nbsp;&nbsp;&nbsp;&nbsp; <a href=3D"https://lists.sourceforge.net/lis=
ts/listinfo/wbxmllib-devel">https://lists.sourceforge.net/lists/listinfo/wb=
xmllib-devel
</a><br>&gt;<br>&gt;<br>&gt;<br>&gt;<br>&gt; --<br>&gt; Med venlig hilsen /=
 Best regards<br>&gt; Rasmus Lock Larsen<br>&gt; <a href=3D"mailto:rasmus.l=
[email protected]">[email protected]</a> &lt;mailto:<a href=
=3D"mailto:[email protected]">
[email protected]</a>&gt;<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