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

Problem copying xhtml elements from xml source

Subject: Problem copying xhtml elements from xml source
From: "cking" <cking@xxxxxxxxxx>
Date: Tue, 13 Jul 2004 00:39:12 +0200
problem copying
Hello,

I didn't get many replies, maybe because I didn't include the code,
only the link to my testcase. So here's my question again:
is this a correct way to copy xhtml elements from an xml source file? 

** source xml:

<?xml version="1.0" encoding="iso-8859-1"?>
<?xml-stylesheet type="text/xsl" href="test-copy-of.xsl"?>
<test-copy-of>
  <p style="color:red;">a paragraph in <b>red</b></p>
  <p><img src="wood102.jpg" width="149" height="177" alt="wood"/></p>
</test-copy-of>

** test-copy-of.xsl:

<xsl:stylesheet
  version="1.0"
  xmlns="http://www.w3.org/1999/xhtml"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  >
 
  <xsl:output
    method="xml"
    encoding="iso-8859-1"
    indent="yes"
    doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
    doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
    />
 
  <xsl:template match="/test-copy-of">
    <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
      <head>
        <title>test-copy-of</title>
        <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"/>
      </head>
      <body>
        <div>
          <xsl:copy-of select="*"/>
        </div>
      </body>
    </html>
  </xsl:template>
 
</xsl:stylesheet>

This works as expected in IE6 and Saxon, but in Mozilla/Firefox,
all formatting is lost (as if only text nodes come through).

The Mozilla folks say that the error is in the stylesheet. The reason
would be, that the elements from the source file are not in the
xhtml namespace. Is that true? And if yes, how can I make this work?

Full testcase at http://users.telenet.be/cking/webstuff/test/copy-of/info.html
Bugreport: http://bugzilla.mozilla.org/show_bug.cgi?id=250921

Thanks for any help!
Anton Triest

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.