W3C home > Mailing lists > Public > html-tidy@w3.org > April to June 2003

Re: how to remove the namespace declaration in the XHTML generated from HTML Tidy

From: Bjoern Hoehrmann <derhoermi@gmx.net>
Date: Sat, 17 May 2003 13:46:26 +0200
To: "Ming Wu" <wu@in.tum.de>
Cc: <html-tidy@w3.org>
Message-ID: <3ed41f55.87814160@smtp.bjoern.hoehrmann.de>

* Ming Wu wrote:
>        my current job is to generate an XHTML file from HTML
>with HTML Tidy, then using XSLT to transform XHTML into XML.
>But the problem is that in the newly generated XHTML File,
><html xmlns="http://www.w3.org/1999/xhtml"> the namespace is
>added automatically by HTML Tidy.  With this declaration, the
>XSLT won't work at all.  Does anyone have any idea, how could
>it be worked out using the config.txt from HTML Tidy or other
>approaches?  Any help will be appreciated, thanks in advance.  

You need to declare and use the XHTML namespace in your XSLT document,

  <xsl:transform ... xmlns:x='http://www.w3.org/1999/xhtml'>

    <xsl:template match = 'x:p'>
      <!-- do something with paragraphs -->


However, what about a boolean 'xhtml-namespace' config option?
Received on Saturday, 17 May 2003 07:46:41 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:06:49 UTC