我最近将几个我的.xml文件从docbook更改为dita.转换没问题,但有一些不需要的工件.我难以理解的是.dita没有<para>从docbook中识别标签,而是将其替换为<p>.您认为没问题,但这会导致XML在下一行显示项目和有序列表,即:
1 item One 2 item Two
代替:
1 item One 2 item Two
所以我该如何改变这个:
<section>
<title>Cool Stuff</title>
<orderedlist>
<listitem>
<para>ItemOne</para>
</listitem>
<listitem>
<para>ItemTwo</para>
</listitem>
</orderedlist>
Run Code Online (Sandbox Code Playgroud)
对此:
<section>
<title>Cool Stuff</title>
<orderedlist>
<listitem>
ItemOne
</listitem>
<listitem>
ItemTwo
</listitem>
</orderedlist>
Run Code Online (Sandbox Code Playgroud)
对不起,我应该更清楚这个问题.我需要从不同深度的doument中删除所有标签,但始终遵循(本地)树listitem/para.我对此有点新意,但是我可以通过将其添加到我的docbook2dita转换中来做错.可以在那个地方吗?
我从DITA技术开始.我已经阅读了DITA文档的基本结构.现在,我怀疑如下:
如何将自己的标签添加到DITA文档?,我应该创建一个基于topic.dtd的.DTD文件,如http://docs.oasis-open.org/dita/v1.2/cd03/dtd1.2 /base/dtd/basetopic.dtd?
问候!
问题:我想将所有嵌套的无序列表切换为破折号而不是子弹.
我相信选择这些嵌套列表项的XPath表达式是:// ul/li/ul // li
我相信这是适合修改的模板:
<xsl:template match="*[contains(@class, ' topic/ul ')]/*[contains(@class, ' topic/li ')]">
<fo:list-item xsl:use-attribute-sets="ul.li">
<fo:list-item-label xsl:use-attribute-sets="ul.li__label">
<fo:block xsl:use-attribute-sets="ul.li__label__content">
<fo:inline>
<xsl:call-template name="commonattributes"/>
</fo:inline>
<xsl:call-template name="insertVariable">
<xsl:with-param name="theVariableID" select="'Unordered List bullet'"/>
</xsl:call-template>
</fo:block>
</fo:list-item-label>
<fo:list-item-body xsl:use-attribute-sets="ul.li__body">
<fo:block xsl:use-attribute-sets="ul.li__content">
<xsl:apply-templates/>
</fo:block>
</fo:list-item-body>
</fo:list-item>
</xsl:template>
Run Code Online (Sandbox Code Playgroud)
它引用了名为"Unordered List Bullet"的en.xml中的变量:
<variable id="Unordered List bullet">•</variable>
Run Code Online (Sandbox Code Playgroud)
我已经尝试将该变量调用包装为引用另一个变量"Unordered List Dash"(如果它是嵌套的).我还是有点挂了.什么是最优雅的方法?我应该为这些嵌套项目设置一个额外的模板吗?
我正在使用DITA-OT 1.5.4.
DITA-OT:1.7.3
问题:我的自定义样式表中的空章节出错:
"fo:block-container" is missing child elements. Required content model: marker* (%block;)+
默认的PDF2样式呈现正常.
在章节中添加主题会使其消失.该错误只给出了topic.fo的最后一行,其中列为0.
这是页面序列(缩进),错误所在的行在id ="d2e394"之前开始:
<fo:page-sequence
xmlns:xs="http://www.w3.org/2001/XMLSchema"
force-page-count="no-force"
initial-page-number="1"
master-reference="body-sequence">
<fo:static-content
flow-name="xsl-footnote-separator">
<fo:block>
<fo:leader
color="black"
leader-length="25%"
leader-pattern="rule"
rule-style="solid"
rule-thickness="0.5pt"/>
</fo:block>
</fo:static-content>
<fo:static-content
flow-name="odd-body-footer">
<fo:table
font-size="8pt"
space-after="0.5in"
space-after.conditionality="retain"
text-align="end"
line-height-shift-adjustment="disregard-shifts"
font-family="Helvetica, Arial Unicode MS">
<fo:table-column
column-width="40%"/>
<fo:table-column
column-width="20%"/>
<fo:table-column
column-width="40%"/>
<fo:table-body>
<fo:table-row>
<fo:table-cell>
<fo:block
margin-left=".93in"
text-align="left">PN: XXXXXX</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block
text-align="center">
<fo:retrieve-marker
retrieve-class-name="current-chapter-number"/>-<fo:page-number/>
</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block
margin-right="0.74in"
text-align="right">
<fo:retrieve-marker
retrieve-class-name="current-document-header"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
</fo:static-content>
<fo:static-content
flow-name="even-body-footer">
<fo:table …Run Code Online (Sandbox Code Playgroud) 我们正在将旧版HTML文件转换为DITA.我想在href属性中转换带有反斜杠的Windows路径
<a href="c:\developer\file.html">
Run Code Online (Sandbox Code Playgroud)
转发斜线
<xref href="c:/developer/file.dita">
Run Code Online (Sandbox Code Playgroud)
我试图使用替换和翻译(XSLT是v2)但没有成功.我也尝试了http://geekswithblogs.net/Erik/archive/2008/04/01/120915.aspx上的string.replace方法,结果相同.
我试图在选择的概念文件之间建立关系.因此,给定三个文档"A","B"和"C",我希望它们各自显示如下内容:
一个 ...
相关概念
- 乙
- C
由于某种原因,以下不起作用:
<reltable>
<relrow>
<relcell>
<topicgroup collection-type="family">
<topicref href="topics/a.dita" type="concept"/>
<topicref href="topics/b.dita" type="concept"/>
<topicref href="topics/c.dita" type="concept"/>
</topicgroup>
</relcell>
</relrow>
</reltable>
Run Code Online (Sandbox Code Playgroud)
以下工作,但这肯定是不正确的:
<reltable>
<relrow>
<relcell>
<topicgroup collection-type="family">
<topicref href="topics/a.dita" type="concept"/>
<topicref href="topics/b.dita" type="concept"/>
<topicref href="topics/c.dita" type="concept"/>
</topicgroup>
</relcell>
<relcell>
<topicgroup collection-type="family">
<topicref href="topics/a.dita" type="concept"/>
<topicref href="topics/b.dita" type="concept"/>
<topicref href="topics/c.dita" type="concept"/>
</topicgroup>
</relcell>
</relrow>
</reltable>
Run Code Online (Sandbox Code Playgroud)
我正在使用XMLMind 的开源DITA转换器.