2016-01-13 101 views
1

我想创建基于link元素的新元素。对于作者来说,这比使用roleotherrole属性来指定链接角色更舒适。我如何专注链接元素(相关链接)

不幸的是,DITA-OT 2.2.1失败,此消息:

Required item type of result of template related-links:link. 
    is element(Q{}link); supplied value has item type 
    element(Q{}myelement) 

这是一个有效的办法,还是应该坚持otherrole

更新1: 在发生错误的related-links.xsl

<!-- Ungrouped links have the default-mode 
    template applied to them. (Can be overridden.) --> 
<xsl:template match="*[contains(@class, ' topic/link ')]" 
       mode="related-links:link" 
       name="related-links:link." 
       as="element(link)"> 
    <xsl:sequence select="."/> <!--- error points to this line --> 
</xsl:template> 
+0

你还可以发布问题出现的XSLT模板+行吗?如果问题一致,也许可以在DITA OT Bugs列表中添加一个错误。 –

+0

此行导致错误[beetle.dita#L23](https://github.com/doctales/org.doctales.terminology/blob/0b7384483956473a7d019091baf7d60f331547ac/samples/beetle.dita#L23)。 –

+0

两种变体都不起作用: - <!ATTLIST hyponym%global-atts; class CDATA“ - topic/link”>' - '<!ATTLIST hyponym%global-atts; class CDATA“ - topic/link termentry/hypernym”>' –

回答

1

这显然是在XSLT实现中的错误,因为你不能使用直接标记名检查与任何DITA处理,因为它会失败面对专业化,正如你所看到的。

边注:假设您的专业是一个域,域的名称应在“-d”结束每DITA命名约定:

类=“ - 专题/链接myLink的-d/mylinktype”

这是一个约定,不是一个硬性要求,但能够查看@class值并知道元素是来自域还是结构专用化是有用的。

+0

这不是一个域的规范,但非常感谢提醒。这是[术语管理的新话题类型](https://github.com/doctales/org.doctales.terminology)。我提出了一个问题:[dita-ot#2197](https://github.com/dita-ot/dita-ot/issues/2197) –