7

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 able to successfully work with the builds on win32 platforms.

Olaseni
  • 7,698
  • 16
  • 44
  • 68

2 Answers2

2

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

JC.
  • 670
  • 3
  • 12
  • Hey thanks - I'll check it out to see if I indeed don't need to have the xml2wbxml binary in my path – Olaseni Nov 07 '10 at 06:44
1

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.

GordonM
  • 31,179
  • 15
  • 87
  • 129
  • I understand - thanks for the suggestions. It's just that I wouldn't need to write my own library if there's one available. – Olaseni Oct 28 '10 at 08:55