Hello List,
i want to create an "closing" element with a condition.
Base is only XSLT 1.0 - Xalan
There is a dynamic part <w:t> in the xslt process and i want to close the
</w:p> with a condition.
The condition is in a 5 level deep recursion, so i try to simplify the example
here.
<w:p>
<w:t>This is my content</w:t>
</w:p>
it can be also (only for example - the example is reduced to the min)
<w:p>
<w:t>This is my content</w:t>
<w:t>This is the new content</w:t>
<w:t>This is the other content</w:t>
</w:p>
I can't say at the beginning of <w:p> how many <w:t> will follow and so i have
an exit in the <w:t>.value, which gives me the Base of the Condition.
The template idea was:
<xsl:template name="xParagraph">
<xsl:param name="xValue"/>
<xsl:choose>
<xsl:when test="contains($xValue, 'Start')">
<xsl:element name="p"
namespace="http://schemas.microsoft.com/office/word/2003/wordml"/>
</xsl:when>
<xsl:when
test="not(contains($xValue, 'Cont')) and not(contains($xValue,
'End')) ">
<xsl:element name="p"
namespace="http://schemas.microsoft.com/office/word/2003/wordml"/>
</xsl:when>
<xsl:when test="contains($xValue, 'End')">
</xsl:element name="p"
namespace="http://schemas.microsoft.com/office/word/2003/wordml"/>
</xsl:when>
<xsl:when
test="not(contains($xValue, 'Cont')) and not(contains($xValue,
'Start')) ">
</xsl:element name="p"
namespace="http://schemas.microsoft.com/office/word/2003/wordml"/>
</xsl:when>
</xsl:choose>
</xsl:template>
But the part of the closing element
</xsl:element name="p"
namespace="http://schemas.microsoft.com/office/word/2003/wordml"/>
doesn't work.
Oxygen gives me the Error back "F [Xalan] The element type "xsl:when" must be
terminated by the matching end-tag "</xsl:when>"."
Another idea was:
<xsl:template name="xParagraph">
<xsl:param name="xValue"/>
<xsl:choose>
<xsl:when test="contains($xValue, 'Start')">
<w:p>
</xsl:when>
<xsl:when
test="not(contains($xValue, 'Cont')) and not(contains($xValue,
'End')) ">
<w:p>
</xsl:when>
<xsl:when test="contains($xValue, 'End')">
</w:p>
</xsl:when>
<xsl:when test="not(contains($xValue, 'Cont')) and
not(contains($xValue, 'Start')) ">
</w:p>
</xsl:when>
</xsl:choose>
</xsl:template>
But Oxygen gives me the Error "F [Xalan] The element type "w:p" must be
terminated by the matching end-tag "</w:p>".
Is there a way to create the closing Tag "</w:p> with a when/if condition?
Any ideas to handle this?
Output is a WordML file.
best regards
armin
Armin Egginger
[x] cross solution
Kurfuerstenstr. 28
82110 Germering
Germany
Phone: +49 - (0)89 - 84 10 25 70
Fax: +49 - (0)89 - 84 10 25 73
USt.ID.: DE176843593
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--