为 iPhone 构建 libxslt

发布于 2024-09-11 01:35:48 字数 1151 浏览 0 评论 0原文

我刚刚有一个应用程序因使用 链接到 libxslt 而被拒绝这种技术

我真的很想在我的应用程序中使用 XSLT,所以看起来我唯一的选择就是自己编译它。我不想使用 UIWebView,因为我想存储生成的 HTML,而不仅仅是显示它。

有没有人这样做过——为iPhone编译libxslt

经过一番谷歌搜索后,我从 这里 和 git 得到了一个旧的 Xcode 解决方案-从 gnome.org 克隆了最新的 libxslt。到目前为止,这两种方法都没有奏效(autoconf 失败了,Xcode 项目丢失了一堆文件)。

任何建议将不胜感激。

谢谢!

更新 7/21

我找到了一种解决方法,即为 UIWebView 提供一些链接到 XSL 样式表的 XML。数据加载后, 我可以像这样获取转换后的 HTML (source ):

- (void)webViewDidFinishLoad:(UIWebView *)webView
{
    html = [webView stringByEvaluatingJavaScriptFromString:
                    @"document.documentElement.outerHTML;"];
}

也就是说,如果有人有任何关于直接使用 libxslt 的提示,我很想听听。陷入 javascript 似乎很……令人讨厌。

I just had an app rejected for linking to libxslt using this technique.

I'd really like to use XSLT in my app, so it looks like my only shot is to compile it myself. I don't want to use a UIWebView because I want to store the resulting HTML, not just display it.

Has anyone done this -- compiled libxslt for the iPhone?

After some Googling, I've got an old Xcode solution from here and git-cloned the latest libxslt from gnome.org. Neither approach has worked out so far (autoconf bails out, and the Xcode project is missing a bunch of files).

Any advice would be appreciated.

Thanks!

Update 7/21

I found a workaround by giving UIWebView some XML linked to an XSL stylesheet. After the data loads,
I can grab the transformed HTML like this (source):

- (void)webViewDidFinishLoad:(UIWebView *)webView
{
    html = [webView stringByEvaluatingJavaScriptFromString:
                    @"document.documentElement.outerHTML;"];
}

That said, if anyone has any hints on using libxslt directly, I'd love to hear them. Dropping into javascript seems so...unsavory.

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

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

发布评论

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

评论(1

薯片软お妹 2024-09-18 01:36:11

您不允许添加 dylib,但可以链接到 .a 文件。您可以配置 libxslt 来输出 .a 文件吗?

You're not allowed to add dylibs, but you can link to a .a file. Can you get the configure for libxslt to output a .a file instead?

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