Xml 前缀为;xsi“;对于属性“;xsi:type";未绑定与元素类型关联的

Xml 前缀为;xsi“;对于属性“;xsi:type";未绑定与元素类型关联的,xml,xslt,xsd,xml-namespaces,Xml,Xslt,Xsd,Xml Namespaces,我编写了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.StringLengthExcept

我编写了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>

de.common.exception.StringLength异常
lfdNr的长度无效:11(最小值:14,最大值:14,内容:“035593111P0”)
在)
201
无效长度
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>


请您解释一下这个错误的含义以及如何消除它好吗?

必须定义XML名称空间前缀,例如
xsi
;否则,XML名称空间格式不正确。不控制XML并不重要。要么告诉你上游的人修复它(无可否认它坏了),要么自己修复

要声明
xsi
,请添加以下内容:
xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance“

另见

错误是由您的输入引起的,而不是由您的XSLT引起的。谢谢Michael,如果不允许我使用SOAP信封,我总是从合作伙伴那里获得此错误格式