Re: [xsl] Transformation with DocType and NameSpace

Subject: Re: [xsl] Transformation with DocType and NameSpace
From: Martin Honnen <Martin.Honnen@xxxxxx>
Date: Thu, 22 Jul 2010 12:30:30 +0200
Ramkumar V wrote:

I am doing HTML to XML Transformation using Saxon/XSLT2.0. Unable to transform when input html contains doc type and Name space as shown below

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "";>
<html xml:lang="en-gb" xmlns="";>

If I remove the doc type and name space, it is working fine. I need to keep this in input file and do the transformation, please provide me the solution for this.

What exactly happens, do you get any error messages? As for taking the namespace into account, that is easy in XSLT 2.0 with <xsl:stylesheet xpath-default-namespace=""; then you can match on XHTML elements simply with e.g. <xsl:template match="html"> and you can use unqualified names in XPath expressions e.g. <xsl:apply-templates select="body//p"/>

The document type could be a problem that requires using a catalog, see


	Martin Honnen

Current Thread