- xml - AJAX/Jquery XML 解析
- 具有多重继承的 XML 模式
- .net - 枚举序列化 Json 与 XML
- XML 简单类型、简单内容、复杂类型、复杂内容
我试图在我的 XSLT 样式表中使用这两个字符串函数(matches
和 replace
)。但是在运行时,我得到以下错误 matches
和类似的 replace
错误:
Caused by: org.xml.sax.SAXException: Parse Error in matches function.
oracle.xdo11g.xpath.XPathException: Parse Error in matches function.
at oracle.xdo11g.xslt.XSLProcessor.reportException(XSLProcessor.java:965)
at oracle.xdo11g.xslt.XSLProcessor.newXSLStylesheet(XSLProcessor.java:725)
at oracle.xdo11g.parser.v2.XSLProcessor.newXSLStylesheet(XSLProcessor.java:391)
xslt 处理器版本为 2.0,根据 http://www.w3schools.com/xsl/func_systemproperty.asp 应支持这些功能.
我还尝试复制 w3org ( http://www.w3.org/TR/xpath-functions/#func-matches) 上列出的简单示例,但仍然是同样的问题。
奇怪的是,字符串函数contains
和translate
工作得很好。
这是我的简单 XSLT 样式表:
<?xml version='1.0' encoding='utf-8'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="2.0">
<xsl:output method="xml" encoding="UTF-8" indent="yes"/>
<xsl:template match="/">
<xsl:value-of select="system-property('xsl:version')" />
<xsl:value-of select="system-property('xsl:vendor')" />
<xsl:value-of select="matches('abracadabra', 'bra')"/> <!-- gives error-->
<xsl:value-of select="replace('abracadabra', 'bra', '*')"/><!-- gives error-->
<xsl:value-of select="translate('abracadabra','ab','34')"/><!-- works fine-->
<xsl:value-of select="contains('abracadabra', 'bra')"/><!-- works fine-->
</xsl:template>
</xsl:stylesheet>
无论我的 XML 输入如何,这些都应该有效。任何人都可以建议这里出了什么问题以及如何解决这个问题吗?
最佳答案
Oracle's XML Developer's Kit (12c Release 1)仅部分支持 XSLT 2.0。不幸的是,fn:matches
和 fn:replace
是 not supported :
Some features of these specifications are not supported in the current release:
- The Schema Import and Static Typing features are not supported, but the XML Schema built-in types specified by the XPath 2.0 Datamodel
are supported.- The schema-element and schema-attribute nodetests are not supported.
- The XSLT instruction xsl:number uses XSLT 1.0 semantics and syntax.
- The use-when standard attribute is not supported.
- The processor does not honor the attribute of required on xsl:param.
- Tunnel parameters are not supported.
- Regular expression instructions are not supported in XSLT.
- The XPath 2.0 functions fn:tokenize, fn:matches, and fn:replace are not supported.
- format-dateTime, format-date, and format-time functions are not supported.
- The content model for xsl:attribute, xsl:comment, xsl:message and the way to compute key values of xsl:key and xsl:sort are still 1.0 behavior.
- attribute [xsl:]inherit-namespaces for xsl:copy, xsl:element, and literal result elements is not supported.
这种部分支持是否证明从
返回2.0
<xsl:value-of select="system-property('xsl:version')" />
是个有趣的问题。
关于java - 为什么 fn :matches and fn:replace throwing parse errors in XSLT 2. 是 0?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28990021/
我正在尝试为匹配中的每个匹配呈现一些 HTML,但是,我不太确定 实际上是正确的。 更具体地说,我不确定我是否可以使用 v-bind:match='match'在与循环相同的元素上 v-for='ma
它具有看似简单的代码: method match(Any:U: |) { self.Str; nqp::getlexcaller('$/') = Nil } 但是,这是它的行为: (^3).matc
如果您想检查某项是否与正则表达式匹配,如果是,请打印第一组,您就可以了.. import re match = re.match("(\d+)g", "123g") if match is not N
以下两个查询的结果有差异吗? SELECT * FROM table1, table2 WHERE ( MATCH(table1.row1) AGAINST('searchstring' IN
我正在尝试为我的日志文件创建一个语法文件。它们采用以下格式: [time] LEVEL filepath:line - message 我的语法文件如下所示: :syn region logTime
String#match 和 Regexp#match 在匹配成功时返回一个 MatchData: "".match(//) # => # //.match("") # => # //.match(:
我的代码中有这个函数: func match(match: GKMatch, player playerID: String, didChangeState state: GKPlayerConnec
我对 match 和 case 之间的区别感到困惑。在 document ,其中提到match支持通用模式匹配。 > (define (m x) (match x [(list a
我在检查特定元素中的空 HTML 内容时遇到了问题。当我使用 someElement.trim().match("") 即使 HTML 内容为空,我有时也会得到 true。我改成了 someEleme
我正在尝试使用正则表达式查找包含特定词的两个词之间的所有内容,但是这些词是重复的,所以我没有得到我想要的匹配项。 例如,我想要“你好”和“再见”之间的所有内容,以便它们之间存在“苹果”一词: hell
我目前正在构建一个 PHP 脚本,它将在需要时响应 HTTP“304 Not Modified”。 (请参阅 question #2086712 了解我目前所做的事情)。 目前我回答以下问题: If-
给定以下 XML 10 我希望能够正确识别内部 的 s : result = subject.gsub(/]*>)/, '<') 解释: ]* # any number of charact
这个问题在这里已经有了答案: How to error handle 1004 Error with WorksheetFunction.VLookup? (3 个回答) 3年前关闭。 目标:查找输入
我已经尝试了好一阵子了,但是我似乎无法弄清楚这两者之间的区别。特别是,与数据数组有关的差异: PS C:>$myarray = "a", "ab", "abc" PS C:>$myarray -mat
我正在努力研究如何构建一个宏,让我可以将模式和结果以向量的形式传递给 core.match/match 。我希望能够做到这一点: (let [x {:a 1} patterns [[{:a
这个问题在这里已经有了答案: Reference - What does this regex mean? (1 个回答) 关闭 8 年前。 如果这看起来微不足道但只是为了理解正则表达式,请原谅我:
我的 MySQL 表中有大约 20 行,其 Title 列为 Elsewhere 并具有其他不同的列参数。 我目前正在使用这样的查询,因为我的大多数搜索(通过 PHP 文件)都需要我进行猜测。所以我使
当找到匹配时,我必须从字符串中删除单词 让我们看看 我的输入字符串是 “肯诺克斯路” 比赛表演中的单词表 街道 驾驶 道路 4. 车道 输出字符串应该是: KENOX 我正在使用 vb.net 作为此
我正在搜索以下形式的字符串模式: XXXAXXX # exactly 3 Xs, followed by a non-X, followed by 3Xs 所有的 X 必须是相同的字符,并且 A 不能
好吧,我是 gulp 和 sass 的新手,我正在努力让它发挥作用。我正确安装了所有东西,但我收到了这个愚蠢的错误。有解决办法吗? PS C:\Users\Bojan Kolano\Desktop\F
我是一名优秀的程序员,十分优秀!