我们如何在不下载源代码的情况下使用 EXSLT? [英] How can we use EXSLT without downloading its source?

查看:40
本文介绍了我们如何在不下载源代码的情况下使用 EXSLT?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

XSLTSL 似乎声称我们可以在不下载源代码的情况下使用 EXSLT:

XSLTSL seems to claim that we can use EXSLT without downloading its source:

直接从库网站导入或包含主样式表或您希望使用的样式表模块;http://xsltsl.sourceforge.net/modules/.modules 目录总是包含最新的稳定版本.

Import or include either the main stylesheet, or the stylesheet module you wish to use, directly from the library website; http://xsltsl.sourceforge.net/modules/. The modules directory always contains the latest stable release.

我已经试过了:

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:import href="http://xsltsl.sourceforge.net/modules/string.xsl"/>
  <xsl:output method="text" indent="yes"/>

  <xsl:template match="/">
    <xsl:call-template name="str:to-upper">
      <xsl:with-param name="text">hello world</xsl:with-param>
    </xsl:call-template>
  </xsl:template>
</xsl:stylesheet>

但它不起作用.如果不下载源代码,我似乎无法使用 EXSLT.

But its not working. I don't seem to be able to use EXSLT without downloading its source.

有没有办法在不下载源代码的情况下使用 EXSLT?

Is there anyway to use EXSLT without downloading its source?

推荐答案

您没有正确使用库.查看此处的说明.

You are not using the library correctly. Take a look at the instructions here.

下载库后,您需要:

1) 向您的 xsl 文件添加导入:

1) Add an import to your xsl file:

<xsl:import href="string.xsl"/>

2) 添加命名空间:

xmlns:str="http://xsltsl.org/string"

3) 像这样调用模板:

3) Call the template like this:

<xsl:template match="foo">
  <xsl:call-template name="str:to-upper">
    <xsl:with-param name="text">hello world</xsl:with-param>
  </xsl:call-template>
</xsl:template>

这将产生HELLO WORLD.

更新:

不,您不需要在本地下载库.您可以使用完整的 URL 简单地链接到 string.xsl.

No, you do not need to download the library locally. You can simply link to string.xsl using the full URL.

这篇关于我们如何在不下载源代码的情况下使用 EXSLT?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆