[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Process XHTML embedded in XML

Subject: Re: Process XHTML embedded in XML
From: David Carlisle <davidc@xxxxxxxxx>
Date: Fri, 1 Jun 2001 13:39:57 +0100
xml embedded in xhtml
This is a VFAQ,

  <xsl:apply-template select="caption" />
  <xsl:template match="caption">

select and match caption in the null namespace, but you want to match
elements in XHTML so

  <xsl:apply-template select="h:caption" />
  <xsl:template match="h:caption">

and stick xmlns:h="http://www.w3.org/1999/xhtml"  in your xsl:stylesheet
start tag, so the h prefix is available everywhere in the stylesheet.

You are using value-of on the content of the caption so you lose the
<b> element. If you wanted to keep that you could use copy-of or
apply-templates (with a template for h:b)

Also you've written your template in a very verbose way.

       <xsl:element name="table">
         <xsl:element name="tr">
                <xsl:element name="td"> 
             <xsl:attribute name="align">center</xsl:attribute>
             <xsl:attribute name="width">100</xsl:attribute>
             <xsl:attribute name="height">100</xsl:attribute>
             <xsl:element name="img">
               <xsl:attribute name="src">
                <xsl:value-of select="@filename"/>
            </xsl:attribute>
               <xsl:attribute name="alt">
                <xsl:value-of select="@filename"/>
            </xsl:attribute>
             </xsl:element>
                </xsl:element>
         </xsl:element>


is equivalent to

<table>
<tr>
<td align="center" width="100" height="100">
  <img src="{@filename}" alt="{@filename}"/>
</td>
</tr>



David

_____________________________________________________________________
This message has been checked for all known viruses by Star Internet
delivered through the MessageLabs Virus Scanning Service. For further
information visit http://www.star.net.uk/stats.asp or alternatively call
01285 884400.

 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.