This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
I disagree with the expected result. $1 refers to the string captured by (a). In this case (a) will match 'a', (b) with match 'b' etc. When matching (a), the captured string $1 will be 'a', ptherwise, it will be the empty string. Therefore I expected <assert-string-value>ak</assert-string-value> to hold. <test-case name="fn-replace-55"> <description>Test case with undefined captures. Saxon bug 2865.</description> <created by="Michael Kay after Gunther Rademacher" on="2016-07-31"/> <test>replace('abcdefghijk', '(a)|(b)|(c)|(d)|(e)|(f)|(g)|(h)|(i)|(j)', '$1') </test> <result> <assert-string-value>abcdefghijk</assert-string-value> </result> </test-case>
I have taken the liberty of fixing this.