Hi all.
This is not really a Cocoon problem, but maybe you can help me with this.
I have the following XHTML page:
<!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>
<title>Page</title>
<link href="" rel="stylesheet" type="text/css" />
</head>
<body>
    <p>Some content</p>
</body>
</html>
 
and I want to parse it and take out the link to external stylesheet.
So I wrote the following xsl:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 
<xsl:template match="node()|@*">
<xsl:copy>
<xsl:apply-templates select="node()|@*" />
</xsl:copy>
</xsl:template>
 
<xsl:template match="link[@rel='stylesheet']">
</xsl:template>
</xsl:stylesheet>
 
Here is my pipeline:
<map:match pattern="parseXhtml">
<map:generate src=""/>
<map:transform src=""/>
<map:serialize type="xml"/>
</map:match>
 
This stylesheet should output the original page without link tag that links to external stylesheet.
The problem is, it doesn't match, e.g. the output is exactly the original input with the link tag left.
 
If I take out the xhtml declaration from the input file, e.g. delete the doctype declaration and xmlns attribute from the html tag, everything works fine.
 
Is there any prorblem in Cocoon/xsl while matching files with xhtml declaration?
 
Can somebody explain this to me.
 
Sorry if this is a bit unrelated and thanks very much for help.
 
Anna

Reply via email to