我在这里疯了..
$(document).on("tap", function (e) {
document.activeElement.blur();
});
无法使用广泛匹配 - 任何正则表达式test
(如示例文件所示),但适用于特定的'^.+$'
我也试过'^C.+$'
但它失败了。
请帮忙。
这是XML文件:
test="string-length(.) > 0"
这是FAILS:的架构师文件
<article>
<back><ack>
<title>Acknowledgements</title>
<p>The authors would like to thank <funding-source rid="sp1">CNPq</funding-source> (Process numbers <award-id rid="sp1">303287/2013-6</award-id> and <award-id rid="sp1">303559/2012-8</award-id>), <funding-source rid="sp2">FAPESP</funding-source> (Process number <award-id rid="sp2">2012/12207-6</award-id>) and <funding-source rid="sp3">CAPES</funding-source> (Process number <award-id rid="sp3">12357-13-8</award-id>) for the financial support.</p>
</ack></back></article>
这是WORKS文件:
<schema xmlns="http://purl.oclc.org/dsdl/schematron"
queryBinding="exslt"
xml:lang="en">
<ns uri="http://www.w3.org/1999/xlink" prefix="xlink"/>
<ns uri="http://exslt.org/regular-expressions" prefix="regexp"/>
<pattern id="funding_info">
<title>Make sure funding-source does not happen inside p</title>
<assert test="regexp:test(current(), '^.+$')">
EC-CHECK: Nao deve haver 'funding-source' nem 'award-id' dentro de 'p'
</assert>
</rule>
</pattern>
</schema>
答案 0 :(得分:1)
似乎XSL中的反斜杠可用于定义转义序列。当您需要定义正则表达式速记字符类时,需要在 literal 反斜杠前面添加特定字符,因此,您需要使用 double 反斜杠:
^[\\s\\S]+$
此模式将匹配:
^
- 字符串开头[\\s\\S]+
- 一个或多个空格或非空白字符(因此,这匹配任何字符)$
- 字符串结束。这也意味着正则表达式的味道不是JavaScript,而this reference声称EXSLT使用JS的味道。