开发者

Pure WBXML encoding for PHP?

开发者 https://www.devze.com 2023-01-07 16:34 出处:网络
Is there a native PHP wbxml API that can be used platform-independently? Perhaps a loadable module? I have seen the pecl implementations but I have not been a开发者_开发知识库ble to successfully work

Is there a native PHP wbxml API that can be used platform-independently? Perhaps a loadable module?

I have seen the pecl implementations but I have not been a开发者_开发知识库ble to successfully work with the builds on win32 platforms.


I am not an expert, but what I found out there numbered two options, essentially.

One, the pecl library that you are having trouble with.

Two, I found WBXML encoder and decoder classes in Horde of all places. They might give you a starting point, and since they are open source, they might meet your needs quite nicely. Here is a link where I found them.

http://phpxref.com/xref/horde/lib/XML/WBXML/index.html


I don't know a huge amount about WBXML, but from what I can gather it's a binary-formatted XML file. I suppose at the simplest you could use the XML modules such as simpleXML to generate your XML document, output it as a string and then use PHP's built in file handling functions (fopen, fwrite, etc) to dump the string as binary data to a file. To reverse the process load the file as a string and have SimpleXML parse it.

However, without knowing the specific details of the WBXML format, I'm sure there's more to it tan that. You'd also have to implement the necessary code yourself, but as you could implement it in PHP itself that should make cross-platform portability a bit simpler to accomplish.

Not really an answer as such, I'm afraid, but I hope it gets you going in the right direction.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号