1
我想将XSD属性@type
的值从xsd:boolean
更改为xsd:string
。如何更改属性值
我的XSD是
<xsd:element name="Complete" nillable="true" type="xsd:boolean"/>
<xsd:element name="taskno" nillable="true" type="xsd:integer"/>
的XSLT我所写的内容替换所有@type
属性值xsd:string
。我无法检查@type
是否为xsd:boolean
。
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
version="1.0">
<xsl:param name="pNewType" select="'xsd:string'"/>
<xsl:template match="node()|@*">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</xsl:template>
<xsl:template match="@type">
<!-- <xsl:if test="type='xsd:boolean'">
Found element!!*********
</xsl:if> --> *** Condition to check if its boolean doesn't work
<xsl:attribute name="type">
<xsl:value-of select="$pNewType"/>
</xsl:attribute>
</xsl:template>
</xsl:stylesheet>