mountainbiker
Programmer
XML (this seems to work when you have a space sandwiched between elements, e.g.,
[tt]</EmphasizedText> <EmphasizedText[/tt]):
[tt]
<doc>
<Para>
Here some <EmphasizedText emphasisType='b'>words</EmphasizedText> <EmphasizedText emphasisType='i'>are recursively
<EmphasizedText emphasisType='b'>
emphasized
</EmphasizedText>
</EmphasizedText>.
However, this word is not. This next word is <EmphasizedText>bold</EmphasizedText>. This word is <EmphasizedText emphasisType='u'>underlined</EmphasizedText>.
</Para>
</doc>
[/tt]
XML (this does not work):
[tt]
<doc>
<Para>
Here some <EmphasizedText emphasisType='b'>words</EmphasizedText> <EmphasizedText emphasisType='i'>are
recursively
<EmphasizedText emphasisType='b'>
emphasized
</EmphasizedText>
</EmphasizedText>.
However, this word is not. This next word is <EmphasizedText>bold</EmphasizedText>. This word is <EmphasizedText emphasisType='u'>underlined</EmphasizedText>.
</Para>
</doc>
[/tt]
XSL:
[tt]
<xsl:template match="doc">
<html>
<head>
<title>A Document</title>
</head>
<body>
<xsl:apply-templates/>
</body>
</html>
</xsl:template>
<xsl:template match="Para">
<p><xsl:apply-templates/></p>
</xsl:template>
<xsl:template match="EmphasizedText">
<xsl:choose>
<xsl:when test="not(@emphasisType) or @emphasisType = 'b'">
<b><xsl:apply-templates/></b>
</xsl:when>
<xsl:when test="@emphasisType = 'i'">
<i><xsl:apply-templates/></i>
</xsl:when>
<xsl:when test="@emphasisType = 'u'">
<u><xsl:apply-templates/></u>
</xsl:when>
</xsl:choose>
</xsl:template>
[/tt]
[tt]</EmphasizedText> <EmphasizedText[/tt]):
[tt]
<doc>
<Para>
Here some <EmphasizedText emphasisType='b'>words</EmphasizedText> <EmphasizedText emphasisType='i'>are recursively
<EmphasizedText emphasisType='b'>
emphasized
</EmphasizedText>
</EmphasizedText>.
However, this word is not. This next word is <EmphasizedText>bold</EmphasizedText>. This word is <EmphasizedText emphasisType='u'>underlined</EmphasizedText>.
</Para>
</doc>
[/tt]
XML (this does not work):
[tt]
<doc>
<Para>
Here some <EmphasizedText emphasisType='b'>words</EmphasizedText> <EmphasizedText emphasisType='i'>are
recursively
<EmphasizedText emphasisType='b'>
emphasized
</EmphasizedText>
</EmphasizedText>.
However, this word is not. This next word is <EmphasizedText>bold</EmphasizedText>. This word is <EmphasizedText emphasisType='u'>underlined</EmphasizedText>.
</Para>
</doc>
[/tt]
XSL:
[tt]
<xsl:template match="doc">
<html>
<head>
<title>A Document</title>
</head>
<body>
<xsl:apply-templates/>
</body>
</html>
</xsl:template>
<xsl:template match="Para">
<p><xsl:apply-templates/></p>
</xsl:template>
<xsl:template match="EmphasizedText">
<xsl:choose>
<xsl:when test="not(@emphasisType) or @emphasisType = 'b'">
<b><xsl:apply-templates/></b>
</xsl:when>
<xsl:when test="@emphasisType = 'i'">
<i><xsl:apply-templates/></i>
</xsl:when>
<xsl:when test="@emphasisType = 'u'">
<u><xsl:apply-templates/></u>
</xsl:when>
</xsl:choose>
</xsl:template>
[/tt]