Understanding elementFormDefault qualified/unqualified when validating xml against a WSDL (xsd schema)

后端 未结 1 472
南笙
南笙 2021-02-05 09:33

I\'m trying to understand the implications of elementFormDefault=\"qualified/unqualified\" in an XML schema which is embedded in WSDL (SOAP 1.1, WSDL 1).

Fo

相关标签:
1条回答
  • 2021-02-05 10:02

    Specifying "qualified" in the schema, which is nearly always the right thing to do, means that local element declarations (xs:element within xs:complexType) refers to elements in the target namespace of the schema. Without it, they refer to elements in no namespace.

    So with qualified, in your case, the name element must be in the namespace http://www.example.com/library. It will be in this namespace if either

    (a) you explicitly put it in this namespace, as in this example:

    <lib:person xmlns:lib="http://www.example.com/library">
        <lib:name>qualified xml</lib:name>
    </lib:person>
    

    (b) or you use a default namespace, as in this example:

    <person xmlns="http://www.example.com/library">
        <name>qualified xml</name>
    </person>
    
    0 讨论(0)
提交回复
热议问题