I have a document like this:
<?xml-stylesheet type="text/css" href="http://ltw1001.web.cs.unibo.it/svg.css" encoding="UTF-8"?>
<!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" xmlns:svg= "http://www.w3.org/2000/svg">
<body>
<svg:svg width="500" height="560" version="1.1" >
...
...
</svg:svg></body></html>
i should extract only the content of body i tred with:
<?xml version="1.0" standalone="no"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="http://www.w3.org/HTML/1998/html4">
<xsl:template match="/">
<xsl:value-of select="//body" />
</xsl:template>
</xsl:stylesheet>
but it don’t work
You have (at least) two problems:
If all you’re trying to accomplish is to output the SVG part as an SVG doctype, then do the following:
<xsl:output ...>tag withdoctype-publicanddoctype-systemattributes specifying the doctype information you want output.This is untested, but should be pretty close. You’ll have to add the doctype info: