[xsl] Process XHTML embedded in XML

Subject: [xsl] Process XHTML embedded in XML
From: Laurent Vaills <laurent.vaills@xxxxxxxxxxxxxx>
Date: Fri, 01 Jun 2001 14:06:31 +0200

Here's my problem : I need to embed in my xml document some comment.
What I want is the comment could be written in a subset of xhtml.
Here is a simple example :
<?xml version="1.0" encoding="ISO-8859-1" ?>

<album >
    <photo filename="tous-01.jpg">
      <caption xmlns="http://www.w3.org/1999/xhtml";>some <b>cool</b>

by describing the document like this I am unable to get the content of
the caption element in my XSL Stylesheet.

Here is my xsl stylesheet :
<?xml version="1.0"?>

<xsl:stylesheet version="1.0" 

<xsl:output method="html"  <--- html or xml ???
            doctype-public= "-//W3C//DTD XHTML 1.0 Transitional//EN" />

  <xsl:template match="/">
    <html lang="fr" >
      <body bgcolor="white">
        <xsl:apply-templates select="album/page"/>

  <xsl:template match="page">
    <xsl:apply-templates select="photo"/>

  <xsl:template match="photo">
       <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 name="alt">
                <xsl:value-of select="@filename"/>
         <xsl:element name="tr">
                <xsl:element name="td"> 
             <xsl:attribute name="align">center</xsl:attribute>
          <xsl:apply-template select="caption" />

  <xsl:template match="caption">
        <font color="white"><i><xsl:value-of select="."/></i></font>


The only way to get content of caption element was to write it as a
CDATA (i.e. <caption><![CDATA[some <b>cool</b> text !!!]]</caption>.
(as described in a mail from mike@xxxxxxxx in august 2000)

What I want is :
1) get the content of caption without qualifying it as CDATA but using
xmlns, which I think is proper.
2) check the content I got is well formed in my xsl stylesheet.

Sorry for this long post.
Hope to describe my problem correctly.
If you want more information, please ask me.


PS : I'm using xalanJ 2.0.1
Laurent Vaills
Sun Microsystems (Grenoble, France) - Intern
Office Phone : +33 (0) 4 76 18 81 09

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

Current Thread