我写了XSLT,但是没有为与元素类型“ RemoteException”相关联的属性“ xsi:type”提供前缀“ xsi”。
我的输入XML是
<RemoteException xsi:type='ns1:Exception' xmlns:ns1='http://errorhandling.service.e2e.de'>
<causeClass xsi:type='xsd:string'>de.common.exception.StringLengthException</causeClass>
<causeMessage xsi:type='xsd:string'>lfdNr has invalid length: 11 (min: 14, max: 14, content: '035593111P0')</causeMessage>
<causeStackTrace xsi:type='xsd:string'>at)</causeStackTrace>
<errorCode xsi:type='xsd:int'>201</errorCode>
<message xsi:type='xsd:string'>invalid length</message>
</RemoteException>
XSLT代码
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" exclude-result-prefixes="xsl soap response ns1 xsi"
xmlns:response="http://tempuri.org/"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:ns1="http://errorhanlding.service.e2e..de"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<!-- Output -->
<xsl:output method="xml" encoding="UTF-8" indent="yes"/>
<xsl:strip-space elements="*"/>
<xsl:template match="/">
<xsl:if test="//RemoteException">
<Fault_MT_Test>
<standard>
<faultText>
<xsl:value-of select="//faultstring"/>
</faultText>
<faultUrl>
<xsl:value-of select="//faultcode"/>
</faultUrl>
</standard>
</Fault_MT_Test>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
您能否就这个错误向我澄清
谢谢卫星]]
我写了XSLT,但是给出了与元素类型“ RemoteException”相关联的属性“ xsi:type”的前缀“ xsi”。我的输入XML是
XML名称空间前缀,例如xsi
,必须定义;否则,XML格式不正确。不控制XML没关系。修复它,或者最好是告诉上游的用户修复它。