1
0
Fork 0

Add namespace to function/template Texinfo output

This allows users to actually...uh..._use_ it.
master
Mike Gerwitz 2015-09-29 22:51:47 -04:00
parent 10b270250f
commit ca28680f79
No known key found for this signature in database
GPG Key ID: F22BB8158EE30EAB
1 changed files with 28 additions and 0 deletions

View File

@ -119,6 +119,9 @@
<variable name="doc" as="xs:string?"
select="xt:get-docblock( . )" />
<variable name="xmlns" as="xs:string"
select="xt:get-xmlns-from-name( @name, . )" />
<variable name="param-str" as="xs:string"
select="string-join( xt:typed-param-str( xsl:param ),
', ' )" />
@ -141,6 +144,8 @@
'@deftypefn ', name(), ' {', $type, '} ',
@name, ' (', $param-str, ')',
$xt:nl,
concat( '@t{', $xmlns, '}' ),
$xt:nl,
$doc,
$xt:nl,
'@emph{Definition:}',
@ -156,6 +161,29 @@
</template>
<!--
Generate xmlns attribute for the namespace prefix of @var{name}
-->
<function name="xt:get-xmlns-from-name" as="xs:string">
<param name="name" as="xs:string" />
<param name="context" as="element()" />
<variable name="prefix" as="xs:string"
select="substring-before( $name, ':' )" />
<sequence select="concat(
'xmlns',
( if ( $prefix ) then
concat( ':', $prefix )
else
'' ),
'=&quot;',
namespace-uri-for-prefix(
$prefix, $context ),
'&quot;' )" />
</function>
<!--
Determine whether the given comment node is a docblock