[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

Subject: Re: How to stream HTML tags included in XML using XSL
From: Toivo Lainevool <tlainevool@xxxxxxxxx>
Date: Tue, 25 Apr 2000 09:40:18 -0700 (PDT)
stream html
--- 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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.