1
0
Fork 0

Proper handling of non-docblock comments

master
Mike Gerwitz 2014-12-19 14:30:37 -05:00
parent 4b51d40bb5
commit ef7d968fe0
1 changed files with 25 additions and 1 deletions

View File

@ -40,7 +40,8 @@
-->
<template match="xsl:stylesheet|xsl:transform">
<apply-templates mode="xt:doc-gen"
select="preceding-sibling::comment()|*" />
select="preceding-sibling::comment()
|node()" />
</template>
@ -105,6 +106,22 @@
</template>
<!--
Determine whether the given comment node is a docblock
-->
<function name="xt:is-docblock" as="xs:boolean">
<param name="node" as="comment()" />
<variable name="next" as="node()?"
select="($node/following-sibling::*
|$node/following-sibling::comment())[ 1 ]" />
<!-- FIXME: this will be a maintenance burden -->
<sequence select="$next instance of element( xsl:template )
or $next instance of element( xsl:function )" />
</function>
<!--
Echo comment blocks
@ -124,6 +141,13 @@
</template>
<!--
Ignore docblock comments (handled in respective templates)
-->
<template mode="xt:doc-gen" priority="7"
match="comment()[ xt:is-docblock( . ) ]" />
<!--
Generate typed parameter list from @var{params}