Skip to content

Commit 0c35f3e

Browse files
committed
xslt update based on metanorma/mn-native-pdf@5e6b6f2
1 parent a6eb0ca commit 0c35f3e

File tree

2 files changed

+128
-0
lines changed

2 files changed

+128
-0
lines changed

lib/isodoc/iho/iho.specification.xsl

+64
Original file line numberDiff line numberDiff line change
@@ -4915,6 +4915,70 @@
49154915
<xsl:value-of select="substring(.,1,1)"/>
49164916
</xsl:template><xsl:template match="*[local-name() = 'title']" mode="title">
49174917
<fo:inline><xsl:apply-templates/></fo:inline>
4918+
</xsl:template><xsl:template match="*[local-name() = 'form']">
4919+
<fo:block>
4920+
<xsl:apply-templates/>
4921+
</fo:block>
4922+
</xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'label']">
4923+
<fo:inline><xsl:apply-templates/></fo:inline>
4924+
</xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'input'][@type = 'text' or @type = 'date' or @type = 'file' or @type = 'password']">
4925+
<fo:inline>
4926+
<xsl:call-template name="text_input"/>
4927+
</fo:inline>
4928+
</xsl:template><xsl:template name="text_input">
4929+
<xsl:variable name="count">
4930+
<xsl:choose>
4931+
<xsl:when test="normalize-space(@maxlength) != ''"><xsl:value-of select="@maxlength"/></xsl:when>
4932+
<xsl:when test="normalize-space(@size) != ''"><xsl:value-of select="@size"/></xsl:when>
4933+
<xsl:otherwise>10</xsl:otherwise>
4934+
</xsl:choose>
4935+
</xsl:variable>
4936+
<xsl:call-template name="repeat">
4937+
<xsl:with-param name="char" select="'_'"/>
4938+
<xsl:with-param name="count" select="$count"/>
4939+
</xsl:call-template>
4940+
<xsl:text> </xsl:text>
4941+
</xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'input'][@type = 'button']">
4942+
<xsl:variable name="caption">
4943+
<xsl:choose>
4944+
<xsl:when test="normalize-space(@value) != ''"><xsl:value-of select="@value"/></xsl:when>
4945+
<xsl:otherwise>BUTTON</xsl:otherwise>
4946+
</xsl:choose>
4947+
</xsl:variable>
4948+
<fo:inline>[<xsl:value-of select="$caption"/>]</fo:inline>
4949+
</xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'input'][@type = 'checkbox']">
4950+
<fo:inline padding-right="1mm">
4951+
<fo:instream-foreign-object fox:alt-text="Box" baseline-shift="-10%">
4952+
<xsl:attribute name="height">3.5mm</xsl:attribute>
4953+
<xsl:attribute name="content-width">100%</xsl:attribute>
4954+
<xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
4955+
<xsl:attribute name="scaling">uniform</xsl:attribute>
4956+
<svg xmlns="http://www.w3.org/2000/svg" width="80" height="80">
4957+
<polyline points="0,0 80,0 80,80 0,80 0,0" stroke="black" stroke-width="5" fill="white"/>
4958+
</svg>
4959+
</fo:instream-foreign-object>
4960+
</fo:inline>
4961+
</xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'input'][@type = 'radio']">
4962+
<fo:inline padding-right="1mm">
4963+
<fo:instream-foreign-object fox:alt-text="Box" baseline-shift="-10%">
4964+
<xsl:attribute name="height">3.5mm</xsl:attribute>
4965+
<xsl:attribute name="content-width">100%</xsl:attribute>
4966+
<xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
4967+
<xsl:attribute name="scaling">uniform</xsl:attribute>
4968+
<svg xmlns="http://www.w3.org/2000/svg" width="80" height="80">
4969+
<circle cx="40" cy="40" r="30" stroke="black" stroke-width="5" fill="white"/>
4970+
<circle cx="40" cy="40" r="15" stroke="black" stroke-width="5" fill="white"/>
4971+
</svg>
4972+
</fo:instream-foreign-object>
4973+
</fo:inline>
4974+
</xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'select']">
4975+
<fo:inline>
4976+
<xsl:call-template name="text_input"/>
4977+
</fo:inline>
4978+
</xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'textarea']">
4979+
<fo:block-container border="1pt solid black" width="50%">
4980+
<fo:block> </fo:block>
4981+
</fo:block-container>
49184982
</xsl:template><xsl:template name="convertDate">
49194983
<xsl:param name="date"/>
49204984
<xsl:param name="format" select="'short'"/>

lib/isodoc/iho/iho.standard.xsl

+64
Original file line numberDiff line numberDiff line change
@@ -4915,6 +4915,70 @@
49154915
<xsl:value-of select="substring(.,1,1)"/>
49164916
</xsl:template><xsl:template match="*[local-name() = 'title']" mode="title">
49174917
<fo:inline><xsl:apply-templates/></fo:inline>
4918+
</xsl:template><xsl:template match="*[local-name() = 'form']">
4919+
<fo:block>
4920+
<xsl:apply-templates/>
4921+
</fo:block>
4922+
</xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'label']">
4923+
<fo:inline><xsl:apply-templates/></fo:inline>
4924+
</xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'input'][@type = 'text' or @type = 'date' or @type = 'file' or @type = 'password']">
4925+
<fo:inline>
4926+
<xsl:call-template name="text_input"/>
4927+
</fo:inline>
4928+
</xsl:template><xsl:template name="text_input">
4929+
<xsl:variable name="count">
4930+
<xsl:choose>
4931+
<xsl:when test="normalize-space(@maxlength) != ''"><xsl:value-of select="@maxlength"/></xsl:when>
4932+
<xsl:when test="normalize-space(@size) != ''"><xsl:value-of select="@size"/></xsl:when>
4933+
<xsl:otherwise>10</xsl:otherwise>
4934+
</xsl:choose>
4935+
</xsl:variable>
4936+
<xsl:call-template name="repeat">
4937+
<xsl:with-param name="char" select="'_'"/>
4938+
<xsl:with-param name="count" select="$count"/>
4939+
</xsl:call-template>
4940+
<xsl:text> </xsl:text>
4941+
</xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'input'][@type = 'button']">
4942+
<xsl:variable name="caption">
4943+
<xsl:choose>
4944+
<xsl:when test="normalize-space(@value) != ''"><xsl:value-of select="@value"/></xsl:when>
4945+
<xsl:otherwise>BUTTON</xsl:otherwise>
4946+
</xsl:choose>
4947+
</xsl:variable>
4948+
<fo:inline>[<xsl:value-of select="$caption"/>]</fo:inline>
4949+
</xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'input'][@type = 'checkbox']">
4950+
<fo:inline padding-right="1mm">
4951+
<fo:instream-foreign-object fox:alt-text="Box" baseline-shift="-10%">
4952+
<xsl:attribute name="height">3.5mm</xsl:attribute>
4953+
<xsl:attribute name="content-width">100%</xsl:attribute>
4954+
<xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
4955+
<xsl:attribute name="scaling">uniform</xsl:attribute>
4956+
<svg xmlns="http://www.w3.org/2000/svg" width="80" height="80">
4957+
<polyline points="0,0 80,0 80,80 0,80 0,0" stroke="black" stroke-width="5" fill="white"/>
4958+
</svg>
4959+
</fo:instream-foreign-object>
4960+
</fo:inline>
4961+
</xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'input'][@type = 'radio']">
4962+
<fo:inline padding-right="1mm">
4963+
<fo:instream-foreign-object fox:alt-text="Box" baseline-shift="-10%">
4964+
<xsl:attribute name="height">3.5mm</xsl:attribute>
4965+
<xsl:attribute name="content-width">100%</xsl:attribute>
4966+
<xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
4967+
<xsl:attribute name="scaling">uniform</xsl:attribute>
4968+
<svg xmlns="http://www.w3.org/2000/svg" width="80" height="80">
4969+
<circle cx="40" cy="40" r="30" stroke="black" stroke-width="5" fill="white"/>
4970+
<circle cx="40" cy="40" r="15" stroke="black" stroke-width="5" fill="white"/>
4971+
</svg>
4972+
</fo:instream-foreign-object>
4973+
</fo:inline>
4974+
</xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'select']">
4975+
<fo:inline>
4976+
<xsl:call-template name="text_input"/>
4977+
</fo:inline>
4978+
</xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'textarea']">
4979+
<fo:block-container border="1pt solid black" width="50%">
4980+
<fo:block> </fo:block>
4981+
</fo:block-container>
49184982
</xsl:template><xsl:template name="convertDate">
49194983
<xsl:param name="date"/>
49204984
<xsl:param name="format" select="'short'"/>

0 commit comments

Comments
 (0)