Re: [Wbxmllib-devel] CDATA encoded into opaque
Rasmus Lock Larsen <[email protected]> Fri, 19 Aug 2005 22:58:28 +0200
| Newsgroups | gmane.comp.gnome.apps.multisync.devel |
|---|---|
| Message-ID | <[email protected]> |
------=_Part_6961_27063666.1124485108256
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
Short: There is no heuristic for OPAQUE.
OPAQUE in WBXML is used to code "application specific" data, i.e. binary=
=20
data that in XML can be represented in either CDATA sections or base64=20
encoded (or hex for that matter).
The short story is, that XML is unambiguous, where as WBXML is ambiguous (=
1=20
XML to N WBXML files, N WBXML files to 1 XML).
So when encoding an XML document in WBXML, the encoder may choose to=20
optimise binary data using the OPAQUE data field (I.e. used in SyncML for=
=20
encoding binary data with the following syntax:
<Meta>
<Format>b64</Format>
</Meta>
<Data>{b64-string}</Data>
Can be coded as binary (OPAQUE) in WBXML provided that the Format element=
=20
changes to "bin".
Similar handling of binary data is used in DRM and some messaging (cant=20
remember which) application.
To encode CDATA sections as OPAQUE is not a WBXML requirement, but rather =
a=20
nifte feature in the wbxmllib (allowing users to force OPAQUE data encoding=
=20
of elements instead of string entries).
The following XML data (in SyncML):
<Data>str</Data>
can be encoded in many ways in WBXML (all being equally good):
6FC30373747201 - TOKEN+BODY OPAQUE LEN(3) 'str' END-TOKEN
6F037374720001 - TOKEN+BODY STR_I 'str' END-STR END-TOKEN
6F830001 - TOKEN+BODY STR_T INDEX(0) END-TOKEN
Provided that the string-table index 0 holds the string 'str'.
Hope this answers your question?
Br. Rasmus aka Razorax
On 8/19/05, Philippe Laporte <[email protected]> wrote:=20
>=20
> Hi,
> Looking at the code in libwbxml it appears that CDATAs are encoded
> into opaque for WBXML.
>=20
> I couldn't find the section in the WBXML specification document that
> specifies this.
>=20
> Is it specified at all, or is it in any way standardized to do this?
>=20
> Similar question for not encoding in <![CDATA[ and ]]>
> (although of course it makes a lot of sense).
>=20
> So the complementary question is what is the heuristics for knowing
> what's in an OPAQUE section?
>=20
> Thanks,
> Philippe
>=20
>=20
> -------------------------------------------------------
> SF.Net email is Sponsored by the Better Software Conference & EXPO
> September 19-22, 2005 * San Francisco, CA * Development Lifecycle=20
> Practices
> Agile & Plan-Driven Development * Managing Projects & Teams * Testing & Q=
A
> Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
> _______________________________________________
> Wbxmllib-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/wbxmllib-devel
>=20
--=20
Med venlig hilsen / Best regards
Rasmus Lock Larsen
[email protected]
------=_Part_6961_27063666.1124485108256
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
<div>Short: There is no heuristic for OPAQUE.</div>
<div> </div>
<div>OPAQUE in WBXML is used to code "application specific" data,=
i.e. binary data that in XML can be represented in either CDATA sections o=
r base64 encoded (or hex for that matter).</div>
<div> </div>
<div>The short story is, that XML is unambiguous, where as WBXML is ambiguo=
us (1 XML to N WBXML files, N WBXML files to 1 XML).</div>
<div> </div>
<div>So when encoding an XML document in WBXML, the encoder may choose to o=
ptimise binary data using the OPAQUE data field (I.e. used in SyncML for en=
coding binary data with the following syntax:</div>
<div><Meta><br> <Format>b64</Format></div>
<div></Meta></div>
<div><Data>{b64-string}</Data></div>
<div> </div>
<div>Can be coded as binary (OPAQUE) in WBXML provided that the Format elem=
ent changes to "bin".</div>
<div> </div>
<div>Similar handling of binary data is used in DRM and some messaging (can=
t remember which) application.<br> </div>
<div>To encode CDATA sections as OPAQUE is not a WBXML requirement, but rat=
her a nifte feature in the wbxmllib (allowing users to force OPAQUE data en=
coding of elements instead of string entries).</div>
<div> </div>
<div>The following XML data (in SyncML):</div>
<div> </div>
<div><Data>str</Data></div>
<div> </div>
<div>can be encoded in many ways in WBXML (all being equally good):</div>
<div> </div>
<div>6FC30373747201 - TOKEN+BODY OPAQUE LEN(3) 'str' END-TOKEN</div>
<div>6F037374720001 - TOKEN+BODY STR_I 'str' END-STR END-TOKEN</div>
<div>6F830001 - TOKEN+BODY STR_T INDEX(0) END-TOKEN</div>
<div> </div>
<div>Provided that the string-table index 0 holds the string 'str'.</div>
<div> </div>
<div>Hope this answers your question?</div>
<div> </div>
<div>Br. Rasmus aka Razorax<br> </div>
<div><span class=3D"gmail_quote">On 8/19/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> Looking at t=
he code in libwbxml it appears that CDATAs are encoded<br>into opaque for W=
BXML.<br>
<br>I couldn't find the section in the WBXML specification document that<br=
>specifies this.<br><br>Is it specified at all, or is it in any way standar=
dized to do this?<br><br>Similar question for not encoding in &n=
bsp; <![CDATA[ and ]=
]>
<br>(although of course it makes a lot of sense).<br><br>So the complementa=
ry question is what is the heuristics for knowing<br>what's in an OPAQUE se=
ction?<br><br>Thanks,<br>Philippe<br><br><br>------------------------------=
-------------------------
<br>SF.Net email is Sponsored by the Better Software Conference & EXPO<=
br>September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practi=
ces<br>Agile & Plan-Driven Development * Managing Projects & Teams =
* Testing & QA
<br>Security * Process Improvement & Measurement * <a href=3D"http://ww=
w.sqe.com/bsce5sf">http://www.sqe.com/bsce5sf</a><br>______________________=
_________________________<br>Wbxmllib-devel mailing list<br><a href=3D"mail=
to:[email protected]">
[email protected]</a><br><a href=3D"https://lists.source=
forge.net/lists/listinfo/wbxmllib-devel">https://lists.sourceforge.net/list=
s/listinfo/wbxmllib-devel</a><br></blockquote></div><br><br clear=3D"all"><=
br>
-- <br>Med venlig hilsen / Best regards<br>Rasmus Lock Larsen<br><a href=3D=
"mailto:[email protected]">[email protected]</a>=20
------=_Part_6961_27063666.1124485108256--
-------------------------------------------------------
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