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

* 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,
e.g.

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

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

  </xsl:transform>

However, what about a boolean 'xhtml-namespace' config option?

Received on Saturday, 17 May 2003 07:46:41 UTC