|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: How to stream HTML tags included in XML using XSL
--- Marcel Ruff <ruff@xxxxxxxxxxxxx> wrote:
> 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.
One way is to put the html tags in a separate namespace like this:
<doc xmlns="Whatever namespace is default"
xmlns:html="xmlns:html="http://www.w3.org/TR/REC-html40/loose.dtd"">
<aTag>
<html:p>
A paragraph of text...
</html:p>
</aTag>
</doc>
and then use a template to pass through all of the html prefixed tags without
the prefix:
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:html="http://www.w3.org/TR/REC-html40/loose.dtd"
exclude-result-prefixes="html">
... other templates ...
<xsl:template match="html:*">
<xsl:element name="{local-name(.)}"><xsl:apply-templates/>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
That should do the trick.
Toivo Lainevool
__________________________________________________
Do You Yahoo!?
Send online invitations with Yahoo! Invites.
http://invites.yahoo.com
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








