【问题标题】:How to create XML schema with namespace prefix如何使用命名空间前缀创建 XML 模式
【发布时间】:2016-03-03 20:17:19
【问题描述】:

如何为下面的 xml 创建 xml 架构我面临创建带有命名空间前缀的架构的问题:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Body> <sch:GET_ACCT xmlns:sch="http://www.schamst.com/webservice/schemas"> <sch:STATUS>true</sch:STATUS> <sch:ERRORs/> </sch:GET_ACCT> </SOAP-ENV:Body> </SOAP-ENV:Envelope>

【问题讨论】:

    标签: xml schema


    【解决方案1】:

    您只需将 xmlns:sch="" 移动到 SOAP-ENV:Envelope 标记中

    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sch="http://www.schamst.com/webservice/schemas">
        <SOAP-ENV:Body>
            <sch:GET_ACCT>
                <sch:STATUS>true</sch:STATUS>
                <sch:ERRORs/>
            </sch:GET_ACCT>
        </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    

    【讨论】:

    • 其实我想为那个 XML 创建 XML Schema
    • 所以你需要创建类似 w3.org/2001/XMLSchema""> 的定义和把它发给schamst.com/webservice/schemas
    • 不,那不行,我需要为以下 XML 创建:schemas.xmlsoap.org/soap/envelope"> schemas.xmlsoap.org/soap/envelope"> schamst.com/webservice/schemas"> true
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-11-23
    • 2015-03-31
    • 1970-01-01
    相关资源
    最近更新 更多