在myeclipse里,总是提示:
Cannot find the declaration of element 'xsl:stylesheet '
放xml的文件夹也打X,整个工程也打X,虽然不影响使用,但不知道为什么会这样!
是没有写什么DTD等声明吗?我试了好像不行啊,在.net下我用过,一点问题也没有的。
以下是XML文档的代码:
<?xml version= "1.0 "?>
<xsl:stylesheet xmlns:xsl= "http://www.w3.org/TR/WD-xsl ">
<xsl:template match= "/ ">
<xsl:apply-templates />
</xsl:template>
<xsl:template match= "/Tree ">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match= "TreeNode ">
<div class= "clsItem " type= "leaf ">
<xsl:choose>
<xsl:when test= "@NodeImgSrc ">
<img type= "img "> <xsl:attribute name= "src "> <xsl:value-of select= "@NodeImgSrc " /> </xsl:attribute> </img> </xsl:when>
<xsl:otherwise>
<span class= "clsSpace " type= "img "> <span class= "clsLeaf "> . </span> </span> </xsl:otherwise>
</xsl:choose> <span class= "clsLabel " type= "label ">
<xsl:attribute name= "id "> <xsl:value-of select= "@NodeId " /> </xsl:attribute>
<xsl:attribute name= "title "> <xsl:value-of select= "@Title " /> </xsl:attribute>
<xsl:choose>
<xsl:when test= "@Href ">
<a>
<xsl:choose>
<xsl:when test= "@Target ">
<xsl:attribute name= "target "> <xsl:value-of select= "@Target " /> </xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name= "target "> fraContent </xsl:attribute>
</xsl:otherwise>
</xsl:choose>
<xsl:attribute name= "tabindex "> -1 </xsl:attribute>