This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: How to stream HTML tags included in XML using XSL


>-----Original Message-----
>From: Marcel Ruff [mailto:ruff@swand.lake.de]
>we have a XML document and want to add some formatting elements,
>like <bold> or better <b> which should show up in the generated HTML
>file.
>
>How can we tell the XSL engine to stream such tags
>into the destination HTML file.
>
>Using CDATA works fine but is to not very smart to use in XML.
>
>I know we should not use formatting info in XML
>but sometimes it is easier to embed some HTML text into
>my XML.

"XSL 101:"

%%%%%

<xsl:template match="emphasis">
   <b><xsl:apply-templates/></b>
</xsl:template>

<xsl:template match="replaceable">
   <i><xsl:apply-templates/></i>
</xsl:template>

<xsl:template match="variablelist">
   <dl><xsl:apply-templates/></dl>
</xsl:template>

<xsl:template match="varlistentry/term">
   <dt><xsl:apply-templates/></dt>
</xsl:template>

<xsl:template match="itemizedlist">
   <ul><xsl:apply-templates/></ul>
</xsl:template>

<xsl:template match="itemizedlist/listitem">
   <li><xsl:apply-templates/></li>
</xsl:template>

<xsl:template match="blockquote">
   <blockquote><xsl:apply-templates/></blockquote>
</xsl:template>

<xsl:template match="programlisting">
   <blockquote><pre><xsl:apply-templates/></pre></blockquote>
</xsl:template>

<xsl:template match="ulink">
  <a href="{@url}"><xsl:apply-templates/></a>
</xsl:template>


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]