RE: Bad element when DTD specified

Subject: RE: Bad element when DTD specified
From: DPawson@xxxxxxxxxxx
Date: Fri, 3 Sep 1999 20:13:49 +0100
Example showing failure:

xml
<?xml version="1.0"?>
<!DOCTYPE svg SYSTEM "SVG-19990812.dtd">
<svg>
<g>
<desc content="structured text">Contained Description of it</desc>
<title content="structured text">Contained Title of it</title>

<g>
<desc content="structured text">Second desc</desc>
<title content="structured text">Second title</title>
</g>
</g>
</svg>
 
DTD also available at "http://www.w3.org/Graphics/SVG/SVG-19990812.dtd";>

stylesheet

<?xml version="1.0"?>
  <xsl:stylesheet
  xmlns:xsl='http://www.w3.org/XSL/Transform/1.0'
  xmlns="http://www.w3.org/TR/REC-html40";                  
  result-ns="">    
  <xsl:output method="html"/>
<xsl:template match="/" >
 <html>
  <head>
   <title>
    <xsl:text>SVG RDF </xsl:text>
   </title>
  </head>
 <BODY>
<xsl:apply-templates/>
</BODY>
</html>
</xsl:template>
<xsl:template match="g">
  <xsl:choose>
    <xsl:when test="@id">
      <p><b>Item: </b> <xsl:value-of select="@id"/> <br />
      <b> Title: </b><xsl:value-of select="./title"/> <br />
      <b> Description: </b> <xsl:value-of select="./desc"/>
  <xsl:apply-templates/>
</p>
</xsl:when>
<xsl:otherwise>
    <xsl:apply-templates/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="desc">
</xsl:template>
<xsl:template match="title">
</xsl:template>
</xsl:stylesheet>


Output
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html xmlns="http://www.w3.org/TR/REC-html40";>
<head>
<title>SVG RDF </title>
</head>
<BODY>
</BODY>
</html>


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread