Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
谁能推荐一种在 Ruby 应用程序中执行 XML 数据的 XSLT 转换的有效方法?XSL gem (REXSL) 尚不可用,虽然我已经看到一两个实现它的项目,但我对这么早就使用它们持谨慎态度。一位朋友向 Perl 推荐了一个 shell out call,但我担心资源问题。
这是针对linux环境的。
试试“libxslt-ruby”gem。它依赖于 libxml 库的“libxmlr-ruby”绑定,如果你在 Linux 上开发,你可能已经安装了它。
我会建议调用“xsltproc”,它与 linux 中的 libxslt 库一起提供并完成工作。
或者,如果您有任何机会使用 JRuby,那么您有几个用于 java 的 xslt 解析器,您可以在您的 ruby 程序中非常轻松地使用它们。