[sync] WBXML support.
Anthony Mills
amills at gascard.net
Fri Nov 7 09:50:38 PST 2003
Streams as a design element, and using the streams in PHP. Is the
SyncML Reader going to based on something like Document Object Model
(DOM) found at http://www.w3.org/DOM/ or Simple API for XML (SAX) found
at http://www.saxproject.org/. With DOM the entire XML file is loaded
into memory. SAX uses an event firing methods, so it does not require
the whole xml file to be read into memory. I would like to use the
methods found here in the php manual: CIX. XML parser functions. This
is similar to SAX. The last thing to consider is the character sets.
How does PHP, or Horde support multiple character sets? The WBXML
protocol does say what characater set to use. Should I use PHP's built
in stuff or Horde's stuff.
Thanks,
Anthony
Chuck Hagenbuch wrote:
>Quoting Anthony Mills <amills at gascard.net>:
>
>
>
>>Anyway, I will start converting my WBXML code into PHP. I am going to
>>use Streams, because I think it is more elligant. Also, I am going to
>>use a SAX like API. This has two advantages. One it does not require
>>as much memory to run, can be faster, and I don't have to rewrite as
>>much. Second, if done right, you can plugin WBXML and not have to
>>change the SyncML code.
>>
>>
>
>What do you mean by streams, in the context of PHP? Or do you just mean as a
>design element.
>
>
>
>>Here is how it works on my Java program.
>>I check the header to see if it is wbxml encoded or not if it is I
>>create a WBXML parser, else I create a default xml parser. The
>>parsers(SAX) fires methods where it is appropriate. Because they are
>>derived from the same base class, the syncml does not have to know about
>>the encoding. I do the same for the output. If for one reason or
>>another SAX will not work in PHP, you can trick it into using DOM or a
>>full XML file.
>>
>>
>
>That sounds fine, and like it'll integrate well into how rpc.php and the
>Horde_RPC framework work - there's just selection of the backend based on the
>content-type, and then calls a general process method.
>
>Let me know if you have dev questions.
>
>-chuck
>
>--
>Charles Hagenbuch, <chuck at horde.org>
>"I am not that interested in green food." - Average Joe
>
>
>
More information about the sync
mailing list