xslt - XSLT 中的 namespace

标签 xslt namespaces xslt-2.0

我正在学习如何在 XSLT 中执行自定义函数。我发现的每个示例似乎都声明了一个自定义命名空间,例如

<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:mynamespace="http://whatever">

我不明白的是我目前拥有“http://whatever”的地方应该放什么,这是做什么的?我不能使用默认的 xsl 命名空间来创建函数吗?

在此先感谢您的帮助

最佳答案

来自 http://www.w3.org/TR/xslt20/#stylesheet-functions

Note:

The prefix must not refer to a reserved namespace: [see ERR XTSE0080]

来自 http://www.w3.org/TR/xslt20/#dt-reserved-namespace

Definition: The XSLT namespace, together with certain other namespaces recognized by an XSLT processor, are classified as reserved namespaces and must be used only as specified in this and related specifications.

来自 http://www.w3.org/TR/xslt20/#err-XTSE0080

It is a static error to use a reserved namespace in the name of a named template, a mode, an attribute set, a key, a decimal-format, a variable or parameter, a stylesheet function, a named output definition, or a character map.

关于xslt - XSLT 中的 namespace ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5873954/

相关文章:

java - 快速替换 XML 节点值

xml - XSLT:如何从变量中的某个元素获取值?

html - 使用 XSLT 识别特定的 XHTML 单元格,并在找到它们后修改它们的属性

xslt - 删除特定元素的命名空间

c++ - 基于模板参数的动态命名空间使用

string - 如何在 xslt 2.0 中解析字符串到日期

C++ : Using typedefs across multiple files in a namespace.

c++ - 来自 ISO C++ draft (n3290) : 3. 4.3.2/1 命名空间成员的一点

xslt - 在具有多个谓词的模板中确定 position() 的上下文

xml - Xslt:如何拆分字符串并将类添加到两个单词