|
[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
[Recent Entries]
[Reply To This Message]
Re: Transformation with DocType and NameSpace
Subject: Re: 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"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xml:lang="en-gb" xmlns="http://www.w3.org/1999/xhtml">
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="http://www.w3.org/1999/xhtml"
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
http://sourceforge.net/apps/mediawiki/saxon/index.php?title=XML_Catalogs
--
Martin Honnen
http://msmvps.com/blogs/martin_honnen/

|
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format
| RSS 2.0 |
|
| Atom 0.3 |
|
|