VikramSingh
06-25-2008, 06:39 AM
I am facing a problem in while compiling XSLT for the Following Input XML
This is my Input XML..
<Attributes>
<Attribute Name="$State" Value="Available" />
<Attribute Name="$SubType" Value="MeasurementDevice" />
<Attribute Name="AbsoluteDeviationNeg" Value="" />
<Attribute Name="AbsoluteDeviationPos" Value="" />
<Attribute Name="CheckRange" Value="No" />
<Attribute Name="ClippingCheckRange" Value="No" />
<Attribute Name="ClippingIsRangeUsed" Value="False" />
<Attribute Name="FA[w ]" Value="4535" />
<Attribute Name="HasAttachment" Value="True" />
<Attribute Name="IoBus" Value=" " />
<Attribute Name="IsCalibrated" Value="False" />
<Attribute Name="IsExternalSensors" Value="False" />
</Attributes>
and my XSLT is
<xsl:when test="starts-with(@Name,'FA[')">
<xsl:attribute name="{concat('ATTR',translate(@Name,' <>",\ÁáÄäÅåÉéÜüÚúÍíÓóÖöñÑçÇ«»£¤¥§ßØø°¶Ææ¢µ¿();:`´“€!=°_-@+.>$%^?/]~&*$[]#{}|','_'))}">
<xsl:value-of select="@Value"/>
</xsl:attribute>
</xsl:when>
When i implement this XSLT i get a crash with a message:
The ' ' character, hexadecimal value 0x20, cannot be included in a name
Can any one help me in this regard:
This is my Input XML..
<Attributes>
<Attribute Name="$State" Value="Available" />
<Attribute Name="$SubType" Value="MeasurementDevice" />
<Attribute Name="AbsoluteDeviationNeg" Value="" />
<Attribute Name="AbsoluteDeviationPos" Value="" />
<Attribute Name="CheckRange" Value="No" />
<Attribute Name="ClippingCheckRange" Value="No" />
<Attribute Name="ClippingIsRangeUsed" Value="False" />
<Attribute Name="FA[w ]" Value="4535" />
<Attribute Name="HasAttachment" Value="True" />
<Attribute Name="IoBus" Value=" " />
<Attribute Name="IsCalibrated" Value="False" />
<Attribute Name="IsExternalSensors" Value="False" />
</Attributes>
and my XSLT is
<xsl:when test="starts-with(@Name,'FA[')">
<xsl:attribute name="{concat('ATTR',translate(@Name,' <>",\ÁáÄäÅåÉéÜüÚúÍíÓóÖöñÑçÇ«»£¤¥§ßØø°¶Ææ¢µ¿();:`´“€!=°_-@+.>$%^?/]~&*$[]#{}|','_'))}">
<xsl:value-of select="@Value"/>
</xsl:attribute>
</xsl:when>
When i implement this XSLT i get a crash with a message:
The ' ' character, hexadecimal value 0x20, cannot be included in a name
Can any one help me in this regard: