PHP 的纯 WBXML 编码?

发布于 2024-09-10 18:04:10 字数 96 浏览 2 评论 0原文

是否有可以独立于平台使用的本机 PHP wbxml API?也许是一个可加载的模块?

我已经看到了 pecl 实现,但我无法成功地在 win32 平台上使用构建。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

眸中客 2024-09-17 18:04:10

我不是专家,但我发现基本上有两种选择。

一是您遇到问题的 pecl 库。

第二,我在 Horde 的所有地方都找到了 WBXML 编码器和解码器类。它们可能会给您一个起点,并且由于它们是开源的,因此它们可能会很好地满足您的需求。这是我找到它们的链接。

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

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

一枫情书 2024-09-17 18:04:10

我对 WBXML 了解不多,但据我所知,它是一个二进制格式的 XML 文件。我想最简单的是,您可以使用 XML 模块(例如 simpleXML)来生成 XML 文档,将其输出为字符串,然后使用 PHP 内置的文件处理函数(fopen、fwrite 等)将字符串作为二进制数据转储到文件。要反转该过程,请将文件作为字符串加载并让 SimpleXML 对其进行解析。

然而,在不了解 WBXML 格式的具体细节的情况下,我确信还有更多内容。您还必须自己实现必要的代码,但由于您可以在 PHP 本身中实现它,这应该使跨平台可移植性更容易实现。

恐怕这并不是一个真正的答案,但我希望它能让你朝着正确的方向前进。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文