如何使用DITA主题方案图来生成分面搜索的构面

时间:2013-05-24 14:33:04

标签: dita

我有一个DITA主题图,其中包含定义分类的主题方案图。

我的主题图中的主题已使用分类标准中的值进行标记。

如何使用构面渲染主题图以允许回溯主题,其中构面是主题方案图中的值?

2 个答案:

答案 0 :(得分:1)

好吧,除非我误解了这个问题,否则我认为你的意思是渲染到XHTML并且你想要输出中的facet元数据用于最终用户的检索吗?我猜你想要它在meta标签中。

如果是这样,我会这样做:

为了举例,我假设你已经制作了一个映射到@product属性的分类法。

首先,在样式表dita2htmlImpl.xsl中,找到以下模板并将其复制到custom.xsl以覆盖它(作为替代方法,您可以执行另一个模板覆盖{{1}中的get-meta模板},但它太长了......),并添加了对get-meta.xsl的调用:

generateProductMetadata

然后,再次在<xsl:template match="*" mode="chapterHead"> <head><xsl:value-of select="$newline"/> <!-- initial meta information --> <xsl:call-template name="generateCharset"/> <!-- Set the character set to UTF-8 --> <xsl:call-template name="generateDefaultCopyright"/> <!-- Generate a default copyright, if needed --> <xsl:call-template name="generateDefaultMeta"/> <!-- Standard meta for security, robots, etc --> <xsl:call-template name="getMeta"/> <!-- Process metadata from topic prolog --> <xsl:call-template name="copyright"/> <!-- Generate copyright, if specified manually --> <xsl:call-template name="generateCssLinks"/> <!-- Generate links to CSS files --> <xsl:call-template name="generateChapterTitle"/> <!-- Generate the <title> element --> <xsl:call-template name="gen-user-head" /> <!-- include user's XSL HEAD processing here --> <xsl:call-template name="gen-user-scripts" /> <!-- include user's XSL javascripts here --> <xsl:call-template name="gen-user-styles" /> <!-- include user's XSL style element and content here --> <xsl:call-template name="processHDF"/> <!-- Add user HDF file, if specified --> <xsl:call-template name="generateProductMetadata"/> <!-- Add Product metadata --> </head> <xsl:value-of select="$newline"/> </xsl:template> 中添加您调用的模板:

custom.xml

这在测试运行中给出了以下结果:

  <xsl:template name="generateProductMetadata">
    <meta name="product" content="{@product}"/>
    <xsl:value-of select="$newline"/>
  </xsl:template>

这就是你要找的东西吗?

答案 1 :(得分:1)

约翰。

DITA 1.2为您提供了创建分类法或构面层次结构的方法 - subjectScheme映射 - 以及将分类法或构面层次结构应用于DITA内容的方法 - 分类图。

要利用该标记并实现分面浏览体验,您需要做两件事:

  • 在呈现输出时使用主题分类值的处理器
  • 实现分面浏览的查看应用程序

目前,我不知道有任何DITA处理器或查看应用程序执行此操作。