This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
XHTML+XSL --> XSL
- From: Antonio Fiol <fiol at w3ping dot com>
- To: XSL-List <XSL-List at lists dot mulberrytech dot com>
- Date: Wed, 22 May 2002 10:49:36 +0200
- Subject: [xsl] XHTML+XSL --> XSL
- Reply-to: xsl-list at lists dot mulberrytech dot com
Hello,
I have created a fairly simple stylesheet that converts XHTML code into
an XSL that, when used with any XML document, gives back the original
XHTML code.
You may say: This is useless.
And you are absolutely right.
Let's go for an example:
<!-- source1.html -->
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Some title with weird entities like éî</title>
</head>
<body>
</body>
</html>
When applying my XSL, I get an XSL containing, among other things:
[...]
<xsl:template match="/">
<html>
<head>
<title>Sometitle</title>
</head>
<body>
</body>
</html>
</xsl:template>
[...]
*MY GOAL IS BEING ABLE TO use this source file instead* :
<!-- source2.html -->
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Some title with weird entities like éî</title>
</head>
<body>
<xsl:value-of select="/doc/somenode/something" />
<xsl:apply-templates select="/doc/otherthings" />
</body>
</html>
Well, it does not work, as the xsl:* tags are not recognized as being
part of XHTML.
I can act on the HTML file header. The only part that must remain
constant is from the <html> tag to the </html> tag.
If I take the <!DOCTYPE ...> out of the document, if I do not have weird
entities somewhere in the document, it works nicely. But if I have
entities not XML standard, it does not work.
Maybe this is not the rightplace to ask. If so, please tell me so.
Thank you very much.
Antonio Fiol Bonnín
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list