原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">
<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>
</xsl:element>
</xsl:template>
</xsl:stylesheet>我的xslt文档里面的<xsl:if test="//HMIControl@type ='GradientTriangle'"> 这句判断怎么没有起上作用呢
写成<xsl:if test="//HMIControl@type =GradientTriangle"> 也不行。
<xsl:if test="@type ='GradientTriangle'"> 这样也不行,昏了,大家帮帮忙,谢谢了 !!!!
<?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">
<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>
</xsl:element>
</xsl:template>
</xsl:stylesheet>我的xslt文档里面的<xsl:if test="//HMIControl@type ='GradientTriangle'"> 这句判断怎么没有起上作用呢
写成<xsl:if test="//HMIControl@type =GradientTriangle"> 也不行。
<xsl:if test="@type ='GradientTriangle'"> 这样也不行,昏了,大家帮帮忙,谢谢了 !!!!
解决方案 »
- 网页分页内容的抓取
- 如何将PictureBox控件的中心直接设定为画图的坐标原点(0,0)
- VSS2005在VS2005下出现的奇怪问题,两天了都没搞定,不能工作了...
- 为什么我总是那么穷呀?除了一天得一个可怜的10分外,还有没有别的方法呀?有没有哪位富人给点可用分给我呀?@_@~
- 自定义Label控件,我想click Label控件,相当于执行窗口的click事件.??
- C#有没有可用的频谱显示控件(能显示语图)
- 关于.net 中C#的RSACryptoServiceProvider 加密解密
- C#初学者问题。请传授!
- 关于DataGrid + DataAdapter + UpdateCommand的有点难度 的问题
- this.richTextBox1.Text.Replease("com","abc")错在哪?
- remoting返回错误信息是乱码
- 求一条分类模糊查询的SQL语句以及文本框内容模糊匹配数据库字段并显示问题,在线,急等...........................
<xsl:if test="//HMIControl[@type='GradientTriangle']">
还是判断不了呀 ,大家帮忙。。