1
0
Fork 0

Attribute selectors now escaped in @match output

master
Mike Gerwitz 2015-04-14 12:12:57 -04:00
parent 5cded3d64b
commit 530407e05d
1 changed files with 26 additions and 1 deletions

View File

@ -66,7 +66,7 @@
<value-of select="concat(
$xt:nl,
'@deffn match {', @mode, '} ',
' on {', @match, '}',
' on {', xt:escape-match( @match ), '}',
$xt:nl,
$doc,
$xt:nl,
@ -75,6 +75,31 @@
</template>
<!--
Escape `at' symbols in matches.
These are common in XPath queries (attribute selectors), but
conflict with the Texinfo command prefix.
-->
<function name="xt:escape-match" as="xs:string">
<param name="match" as="xs:string" />
<variable name="preat" as="xs:string"
select="substring-before( $match, '@' )" />
<variable name="postat" as="xs:string"
select="substring-after( $match, '@' )" />
<sequence select="if ( $preat ) then
concat(
$preat,
'@@',
xt:escape-match( $postat ) )
else
$match" />
</function>
<!--
Generate `template' and `function' definitions