我有一个这样的XML,XML转换失败:预期的Qname?
<?xml version="1.0" encoding="UTF-8"?>
<appcmd>
<APPPOOL APPPOOL.NAME="DefaultAppPool" PipelineMode="Integrated" RuntimeVersion="v2.0" state="Stopped">
<add name="DefaultAppPool" queueLength="1000" autoStart="false" enable32BitAppOnWin64="false">
</add>
</APPPOOL>
</appcmd>
,我已经写了下面的XSLT上述XML转换为另一种XML,
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="yes" omit-xml-declaration="yes" />
<xsl:template match="/appcmd/APPPOOL">
<xsl:variable name="AppName" select="@APPPOOL.NAME"/>
<xsl:element name="{$AppName}">
<xsl:attribute name="Name"><xsl:value-of select="@APPPOOL.NAME"/></xsl:attribute>
<xsl:attribute name="PipelineMode"><xsl:value-of select="@PipelineMode"/>
</xsl:attribute>
<xsl:attribute name="RuntimeVersion"><xsl:value-of select="@RuntimeVersion"/>
</xsl:attribute>
<xsl:attribute name="state"><xsl:value-of select="@state"/></xsl:attribute>
<xsl:copy-of select="add"/>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
我提示以下错误:在 - > XSL :元素名称=“{$ AppName}” XML转换失败:预期的Qname。
请帮我