2016-01-13 103 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) –