From: <svn...@op...> - 2010-02-23 12:58:53
|
Author: bellmich Date: Tue Feb 23 13:40:17 2010 New Revision: 224 URL: http://libwbxml.opensync.org/changeset/224 Log: - The content type of a SyncML data object is now correctly detected even within a CDATA section. - If a vFormat object is embedded into a SyncML message then the line break must be a CRLF. This is a violation of the XML specification but this is a known bug of the SyncML specification. All LFs inside a vFormat object are replaced by a CRLF. - Added a comment about the Nokia ConML support. Modified: wbxml2/trunk/ChangeLog wbxml2/trunk/src/wbxml_tree.c wbxml2/trunk/src/wbxml_tree_clb_xml.c Modified: wbxml2/trunk/ChangeLog ============================================================================== --- wbxml2/trunk/ChangeLog Thu Jun 11 10:12:09 2009 (r223) +++ wbxml2/trunk/ChangeLog Tue Feb 23 13:40:17 2010 (r224) @@ -1,4 +1,10 @@ + * Added Nokia ConML support (ticket #35). + There is no public documentation available from Nokia. The + transformation tables were created from sniffed WBXML documents. + The patch was supplied by Anton D. Kachalov. + 2009-05-12 Michael Bell <mic...@we...> + * Released 0.10.7 * Fixed a Debian MIPS port build issue (ticket #34) If the operating system environment has a built-in getopt implementation then the cmake environment disables the internal @@ -8,6 +14,7 @@ POSIX header files (e.g. optopt). 2009-04-24 Michael Bell <mic...@we...> + * Released 0.10.6 * Extended (updated) tables for Microsoft AirSync (The patch was supplied by Ossi Jormakka from Ixonos Plc.) * Expat splits <html> into three separate text nodes. Modified: wbxml2/trunk/src/wbxml_tree.c ============================================================================== --- wbxml2/trunk/src/wbxml_tree.c Thu Jun 11 10:12:09 2009 (r223) +++ wbxml2/trunk/src/wbxml_tree.c Tue Feb 23 13:40:17 2010 (r224) @@ -793,6 +793,10 @@ if (node == NULL) return WBXML_SYNCML_DATA_TYPE_NORMAL; + /* If we are in a CDATA node then we must look into the parent node. */ + if (node->type == WBXML_TREE_CDATA_NODE) + node = node->parent; + /* Are we in a <Data> ? */ if ((node->type == WBXML_TREE_ELEMENT_NODE) && (node->name != NULL) && Modified: wbxml2/trunk/src/wbxml_tree_clb_xml.c ============================================================================== --- wbxml2/trunk/src/wbxml_tree_clb_xml.c Thu Jun 11 10:12:09 2009 (r223) +++ wbxml2/trunk/src/wbxml_tree_clb_xml.c Tue Feb 23 13:40:17 2010 (r224) @@ -405,11 +405,31 @@ #if defined ( WBXML_SUPPORT_SYNCML ) /* Specific treatment for SyncML */ switch (wbxml_tree_node_get_syncml_data_type(tree_ctx->current)) { - case WBXML_SYNCML_DATA_TYPE_CLEAR: case WBXML_SYNCML_DATA_TYPE_DIRECTORY_VCARD: case WBXML_SYNCML_DATA_TYPE_VCALENDAR: case WBXML_SYNCML_DATA_TYPE_VCARD: case WBXML_SYNCML_DATA_TYPE_VOBJECT: + /* SyncML has some real design bugs + * because the authors of the specification did not understand XML. + * + * There must be a hack to preserve the CRLFs of vFormat objects. + * The only chance to do this is the detection of the vFormat itself + * and the conversion of every LF to a CRLF. + * + * The line breaks are always in a single text node. + * So a CR is appended to get a CRLF at the end. + */ + + if (len == 1 && ch[0] == '\n') /* line break - LF */ + { + ch = "\r\n"; + len = 2; + } + + /* Do not break here. + * The CDATA handling is required for vFormat objects too. + */ + case WBXML_SYNCML_DATA_TYPE_CLEAR: /* * Add a missing CDATA section node * @@ -472,7 +492,7 @@ * </Data> * ... * - * In this example, the spaces beetwen "]]>" and "</Data>" mustn't be added + * In this example, the spaces beetwen "]]>" and "</Data>" must not be added * to a CDATA section. */ if ((tree_ctx->current != NULL) && |