原xml文档:
<?xml version="1.0" encoding="utf-8" ?>
<XMLScreen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <HMIWindow Type="Window" Name="Window_1">
    <Attribute Name="BackColor" Value="ffffffff" />
    <Attribute Name="ImageURI" Value="" />
    <Attribute Name="Enabled" Value="True" />
    <Attribute Name="Visible" Value="True" />
  </HMIWindow>
  <HMIControl Type="GradientRect" Name="GradientRect_1">
    <Attribute Name="Location" Value="98,69" />
    <Attribute Name="Size" Value="122,64" />
    <Attribute Name="Locked" Value="False" />
    <Attribute Name="StartColor" Value="ffffffff" />
    <Attribute Name="EndColor" Value="ff000000" />
    <Attribute Name="Direction" Value="HorizontalSide" />
    <Attribute Name="Enabled" Value="True" />
    <Attribute Name="Visible" Value="True" />
    <Event Name="MouseDown" CallBack="">
      <Code>
      </Code>
    </Event>
    <Event Name="MouseUp" CallBack="">
      <Code>
      </Code>
    </Event>
  </HMIControl> 
    <HMIControl Type="GradientTriangle" Name="GradientTriangle_1">
      <Attribute Name="Point1" Value="194,100" />
      <Attribute Name="Point2" Value="122,174" />
      <Attribute Name="Point3" Value="267,174" />
      <Attribute Name="Locked" Value="False" />
      <Attribute Name="StartColor" Value="ff000000" />
      <Attribute Name="EndColor" Value="ffffffff" />
      <Attribute Name="Direction" Value="Vertical" />
      <Attribute Name="Enabled" Value="True" />
      <Attribute Name="Visible" Value="True" />
      <Event Name="MouseDown" CallBack="">
        <Code>
        </Code>
      </Event>
      <Event Name="MouseUp" CallBack="">
        <Code>
        </Code>
      </Event>
    </HMIControl>
</XMLScreen>XSLT文档:
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:output method="xml"/>
  <xsl:template match="/">
    <xsl:copy>
      <xsl:apply-templates/>
    </xsl:copy>
  </xsl:template> 
  <xsl:template match="//HMIWindow">
    <xsl:text disable-output-escaping="yes"> </xsl:text>
    <xsl:for-each select="//HMIWindow">
      <xsl:element name="HMIWindow">
        <xsl:attribute name="Type">
          <xsl:value-of select="@Type"/>
        </xsl:attribute>
        <xsl:attribute name="Name">
          <xsl:value-of select="@Name"/>
        </xsl:attribute>
        <xsl:attribute name="CType">CWND</xsl:attribute>
        <xsl:attribute name="CName">CWND_1</xsl:attribute>
        <xsl:apply-templates select="Attribute"/>
      </xsl:element>
    </xsl:for-each>
  </xsl:template>
  
  <xsl:template match="//HMIControl">
    <xsl:text disable-output-escaping="yes"> </xsl:text>
    
    <xsl:for-each select="//HMIControl">
     <xsl:if test="//HMIControl@type ='GradientTriangle'">    
      <xsl:element name="HMIControl">      
          <xsl:attribute name="Type">
          <xsl:value-of select="@Type"/>
        </xsl:attribute>
        <xsl:attribute name="Name">
          <xsl:value-of select="@Name"/>
        </xsl:attribute>       
          <xsl:attribute name="CType">C<xsl:value-of select="@Type"/>
          </xsl:attribute>
          <xsl:attribute name="CName">Line_1</xsl:attribute>
        <xsl:apply-templates select="Attribute"/>         
   </xsl:element>      
    </xsl:if>
    </xsl:for-each>
    
  </xsl:template>
  <xsl:template match="Attribute">
    &#10;
    <xsl:element name="Attribute">
      <xsl:attribute name="Name">
        <xsl:value-of select="@Name"/>
      </xsl:attribute>
      <xsl:attribute name="Value">
        <xsl:value-of select="@Value"/>
      </xsl:attribute>
      &#10;
    </xsl:element>
  </xsl:template>
</xsl:stylesheet>我的xslt文档里面的<xsl:if test="//HMIControl@type ='GradientTriangle'"> 这句判断怎么没有起上作用呢 
写成<xsl:if test="//HMIControl@type =GradientTriangle"> 也不行。
<xsl:if test="@type ='GradientTriangle'"> 这样也不行,昏了,大家帮帮忙,谢谢了 !!!!