Short: There is no heuristic for OPAQUE.
OPAQUE in WBXML is used to code "application specific" data, i.e. binary data that in XML can be represented in either CDATA sections or base64 encoded (or hex for that matter).
The short story is, that XML is unambiguous, where as WBXML is ambiguous (1 XML to N WBXML files, N WBXML files to 1 XML).
So when encoding an XML document in WBXML, the encoder may choose to optimise binary data using the OPAQUE data field (I.e. used in SyncML for encoding binary data with the following syntax:
<Meta>
<Format>b64</Format>
<Format>b64</Format>
</Meta>
<Data>{b64-string}</Data>
Can be coded as binary (OPAQUE) in WBXML provided that the Format element changes to "bin".
Similar handling of binary data is used in DRM and some messaging (cant remember which) application.
To encode CDATA sections as OPAQUE is not a WBXML requirement, but rather a nifte feature in the wbxmllib (allowing users to force OPAQUE data encoding 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:
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]
https://lists.sourceforge.net/lists/listinfo/wbxmllib-devel
--
Med venlig hilsen / Best regards
Rasmus Lock Larsen
[EMAIL PROTECTED]