大家好,我是生成 xml/schma 的新手,但我收到 TypeError: 元素“types:ReceiveMessageResponse”的前缀“types”未绑定

问题描述 投票:0回答:1

我得到了

TypeError: The prefix "types" for element "types:ReceiveMessageResponse" is not bound.
at com.orchestral.rhapsody.modules.standard.filters.executescript.ExecuteScript.doProcessMessage(ExecuteScript.java:9)

以下代码错误:

var next = output.append(input[0]);

var output = 

<soap:Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/ xmlns:soapenc=http://schemas.xmlsoap.org/soap/encoding/ xmlns:tns=http://www.show.scot.nhs.uk/sci/gateway/messaging2.0 xmlns:types=http://www.show.scot.nhs.uk/sci/gateway/messaging2.0 xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xmlns:xsd=http://www.w3.org/2001/XMLSchema'>

  <soap:Body soap:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'>

    <types:ReceiveMessageResponse>

      <ReceiveMessageResult href="#id1"/>

    </types:ReceiveMessageResponse>

    <types:GatewayAck id="id1" xsi:type="types:GatewayAck">

      <Code xsi:type="xsd:int">0</Code>

      <Detail xsi:type="xsd:string"/>

      <Source xsi:type="xsd:string"/>

      <UserMsg xsi:type="xsd:string"/>

    </types:GatewayAck>

  </soap:Body>

</soap:Envelope>
next.xml = output;

我尝试为类型再创建一个标签,但没有成功。

javascript xml xslt schema
1个回答
0
投票

必须声明

types
等命名空间前缀。例如,添加以下声明,

xmlns:types="http://example.com/types"

文档/消息中的任何公共祖先元素都会将所有

types
前缀组件放置在
http://example.com/types
命名空间中。

© www.soinside.com 2019 - 2024. All rights reserved.