ndw / xslt-relax-ng

RELAX NG grammars for XSLT 1.0, 2.0, ...
http://norman.walsh.name/2006/07/12/xslt20
MIT License
36 stars 4 forks source link

Tighten content model of xsl:analyze-string #3

Closed Conal-Tuohy closed 7 years ago

Conal-Tuohy commented 7 years ago

The specification documents for XSLT 2 and 3 provide an EBNF which says that the content model of xsl:analyze-string is (xsl:matching-substring?, xsl:non-matching-substring?, xsl:fallback*), but the text of the document specifies an additional restriction:

The content of the xsl:analyze-string instruction must take one of the following forms:

  1. A single xsl:matching-substring instruction, followed by zero or more xsl:fallback instructions
  2. A single xsl:non-matching-substring instruction, followed by zero or more xsl:fallback instructions
  3. A single xsl:matching-substring instruction, followed by a single xsl:non-matching-substring instruction, followed by zero or more xsl:fallback instructions

The existing grammar would allow for an empty xsl:analyze-string element, but this is actually not permitted.