Skip to content

Commit d2a0bf1

Browse files
committed
<ref/>, ignore attributes
* Ignore link/language/@default * Ignore product/desc/@default * For translated deliverables, ignore <deliverable> and use <ref/> and point to the English version
1 parent 3c3983e commit d2a0bf1

1 file changed

Lines changed: 22 additions & 6 deletions

File tree

src/docbuild/config/xml/data/convert-v6-to-v7.xsl

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@
221221
<xsl:value-of select="concat(' href=&quot;', $schemafile, '&quot;')"/>
222222
<xsl:value-of select="concat(' type=&quot;', $type, '&quot;')"/>
223223
</xsl:processing-instruction>
224+
<xsl:text>&#10;</xsl:text>
224225
</xsl:if>
225226
</xsl:template>
226227

@@ -343,16 +344,13 @@
343344
<xsl:variable name="id" select="@productid" />
344345
<xsl:variable name="cnfg" select="$config/product[@id=$id]" />
345346

346-
<!-- Define the subpath for the product file -->
347-
<xsl:variable name="subpath" select="concat($id, '/', $id, '.xml')"/>
348-
349347
<!-- Capture the product content -->
350348
<xsl:variable name="content">
351349
<xsl:apply-templates select="." mode="render"/>
352350
</xsl:variable>
353351

354352
<xsl:call-template name="write.chunk">
355-
<xsl:with-param name="filename" select="$subpath"/>
353+
<xsl:with-param name="filename" select="concat($id, '/', $id, '.xml')"/>
356354
<xsl:with-param name="content" select="$content"/>
357355
</xsl:call-template>
358356
</xsl:template>
@@ -381,7 +379,7 @@
381379
<xsl:for-each select="desc">
382380
<xsl:variable name="lang" select="@lang"/>
383381
<xsl:variable name="inner_content">
384-
<xsl:copy-of select="."/>
382+
<xsl:apply-templates select="." />
385383
</xsl:variable>
386384

387385
<xsl:call-template name="write.chunk">
@@ -405,6 +403,8 @@
405403
<!-- We ignore the product/category as this was moved to portal/categories -->
406404
<xsl:template match="product/category" />
407405

406+
<xsl:template match="product/desc/@default" />
407+
408408
<xsl:template match="product/@productid">
409409
<xsl:attribute name="id">
410410
<xsl:value-of select="."/>
@@ -433,7 +433,7 @@
433433
</xsl:call-template>
434434
</xsl:template>
435435

436-
q <xsl:template match="docset/@setid">
436+
<xsl:template match="docset/@setid">
437437
<xsl:attribute name="id">
438438
<xsl:value-of select="concat(ancestor::product/@productid, $id.sep, .)" />
439439
</xsl:attribute>
@@ -472,6 +472,7 @@ q <xsl:template match="docset/@setid">
472472
</locale>
473473
</xsl:template>
474474

475+
<xsl:template match="link/language/@default" />
475476

476477
<!-- deliverable -->
477478
<xsl:template match="language[@lang='en-us']/deliverable">
@@ -492,6 +493,21 @@ q <xsl:template match="docset/@setid">
492493
</deliverable>
493494
</xsl:template>
494495

496+
<xsl:template match="language[@lang!='en-us']/deliverable">
497+
<xsl:variable name="pid" select="ancestor::product/@productid"/>
498+
<xsl:variable name="abbrev" select="$config/product[@id=$pid]/@idabbrev"/>
499+
<xsl:variable name="product.idabbrev" select="$abbrev | $pid[not($abbrev)]"/>
500+
<xsl:variable name="id">
501+
<xsl:call-template name="generate.id">
502+
<xsl:with-param name="product.idabbrev" select="$product.idabbrev"/>
503+
<xsl:with-param name="docset" select="ancestor::docset/@setid"/>
504+
<xsl:with-param name="dc" select="dc"/>
505+
</xsl:call-template>
506+
</xsl:variable>
507+
508+
<ref linkend="{$id}" />
509+
</xsl:template>
510+
495511
<!-- ref -->
496512
<xsl:template match="ref">
497513
<xsl:variable name="pid" select="@product"/>

0 commit comments

Comments
 (0)