![]() |
![]() | ![]() | ![]() | Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Re: Parsing Augmented XHTML to XHTML using XSL [Thread Next] Re: Parsing Augmented XHTML to XHTML using XSLTo: NULL Date: 3/21/2008 6:49:00 PM
"Martin Honnen" <mahotrash@y...> wrote in message
news:%23I8Lvy0iIHA.3780@T......
> Aaron Gray wrote:
>
>> <xsl:stylesheet version="1.0"
>> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>> xmlns="http://www.w3.org/TR/xhtml1/strict">
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> That is not an XHTML namespace, the namespace for XHTML 1 is
> http://www.w3.org/1999/xhtml.
Thanks I realized that later.
> You will have to decide what the output of the stylesheet should be,
> whether you want HTML 4 with elements being in no namespace or whether you
> want XHTML with elements being in the namespace
> http://www.w3.org/1999/xhtml.
> If the input is really XHTML (meaning elements in the XHTML namespace) and
> you want HTML 4 output then you can't use xsl:copy or xsl:copy-of as you
> then copy the elements including their namespace. Instead you need to
> strip the namespace e.g.
As the subject says I want XHTML to XHTML conversion :)
> <xsl:stylesheet
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> version="1.0"
> xmlns:xhtml="http://www.w3.org/1999/xhtml"
> exclude-result-prefixes="xhtml">
>
> <xsl:template match="xhtml:*">
> <xsl:element name="{local-name()}">
> <xsl:apply-templates select="@* | node()"/>
> </xsl:element>
> </xsl:template>
Adding an output element converting output to UTF-8 :-
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
exclude-result-prefixes="xhtml">
<xsl:output method="html" encoding="UTF-8"/>
<xsl:template match="xhtml:*">
<xsl:element name="{local-name()}">
<xsl:apply-templates select="@* | node()"/>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
This produces malformed output.
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta>content-typetext/html; charset=utf-8
<title>Footnote test</title>
</head>
<body>
This is a test
</body>
</html>
Given :-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Footnote test</title>
</head>
<body>
This is a test
</body>
</html>
Thanks,
Aaron
| ![]() | ![]() | ![]() |
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | |||||
|
