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

后端 未结 1 473
南笙
南笙 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:

    
        qualified xml
    
    

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

    
        qualified xml
    
    

    0 讨论(0)
提交回复
热议问题