xml菜单文件在myeclipse里报错
在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>
<xsl:attribute name= "href "> <xsl:value-of select= "@Href " /> </xsl:attribute>
<xsl:value-of select= "@Title " />
</a>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select= "@Title " />
</xsl:otherwise>
</xsl:choose>
</span>
</div>
</xsl:template>
<xsl:template match= "TreeNode[* or @NodeXmlSrc] ">
<div class= "clsItem " type= "parent ">
<span class= "clsSpace " type= "img "> <span class= "clsCollapse "> + </span> </span> <span class= "clsLabel " type= "label ">
<xsl:attribute name= "xmlsrc "> <xsl:value-of select= "@NodeXmlSrc " /> </xsl:attribute>
<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>
<xsl:attribute name= "href "> <xsl:value-of select= "@Href " /> </xsl:attribute>
<xsl:value-of select= "@Title " />
</a>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select= "@Title " />
</xsl:otherwise>
</xsl:choose>
</span>
<div class= "hide " type= "container "> <xsl:apply-templates /> </div>
</div>
</xsl:template>
<xsl:template match= "@Target ">
<xsl:copy> <xsl:value-of /> </xsl:copy>
</xsl:template>
<xsl:template match= "/TreeNode ">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match= "TreeNode/Tree ">
<xsl:apply-templates />
</xsl:template>
</xsl:stylesheet>
[解决办法]
帮顶 关注中