XSLT中的命名空间 [英] Namespaces in XSLT

查看:117
本文介绍了XSLT中的命名空间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I'm learning how to do custom functions in XSLT. Every example I find seems to declare a custom namespace, e.g.

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

我不明白的是,我现在拥有"http://whatever"的地方应该去哪里,这有什么用?我不能使用默认的xsl命名空间来创建函数吗?

What I don't understand is what should go where I currently have 'http://whatever', and what does this do? Can't I use the default xsl namespace to make functions?

在此先感谢您的帮助

推荐答案

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

注意:

前缀不得引用 保留的命名空间:[

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

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

定义:XSLT名称空间, 连同某些其他名称空间 由XSLT处理器识别的 归类为保留名称空间和 必须仅按此规定使用 和相关规范.

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中的命名空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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