Default rowsep/colsep/frame in transformation if not set
Posted: Thu Jul 21, 2022 4:42 pm
Hi,
I want to define the default setting for frame, rowsep and colsep to true, when nothing is set. We use a merged2mergedExtention.xsl as described here: https://www.oxygenxml.com/doc/versions/ ... plate.html
So I thought it would be great to add the default settings there, but I'm totally stuck.
I managed to insert rowsep and colsep when both is missing (I assume that it is only a misstake when both aren't set, don't know if this makes sense):
But when I add the frame with an <xsl:if>, it doesn't work:
Can anybody help me out and tell me where my mistake is?
Thank you!
Heidi
I want to define the default setting for frame, rowsep and colsep to true, when nothing is set. We use a merged2mergedExtention.xsl as described here: https://www.oxygenxml.com/doc/versions/ ... plate.html
So I thought it would be great to add the default settings there, but I'm totally stuck.
I managed to insert rowsep and colsep when both is missing (I assume that it is only a misstake when both aren't set, don't know if this makes sense):
Code: Select all
<xsl:template match="table[(not(@colsep)) and (not(@rowsep))]">
<table>
<xsl:attribute name="colsep">1</xsl:attribute>
<xsl:attribute name="rowsep">1</xsl:attribute>
<xsl:apply-templates select="@*|node()"/>
</table>
</xsl:template>
Code: Select all
<xsl:template match="table[((not(@colsep)) and (not(@rowsep))) or (not(@frame))]">
<xsl:if table="(not(@colsep)) and (not(@rowsep))">
<table>
<xsl:attribute name="colsep">1</xsl:attribute>
<xsl:attribute name="rowsep">1</xsl:attribute>
<xsl:apply-templates select="@*|node()"/>
</table>
</xsl:if>
<xsl:if table="not(@frame)">
<table>
<xsl:attribute name="frame">all</xsl:attribute>
<xsl:apply-templates select="@*|node()"/>
</table>
</xsl:if>
</xsl:template>
Thank you!
Heidi