How to define xsi:type as an attribute in XML-schema?

后端 未结 2 1079
滥情空心
滥情空心 2021-01-17 18:00

I have an XML for which I want to write a schema definition. The problem is that I don\'t know how to define xsi:type as an attribute. Here is the XML element:



        
2条回答
  •  旧时难觅i
    2021-01-17 18:36

    The xsi:type attribute doesn't need to be declared in the schema: it's implicitly declared, and can be used on any element. But in an instance, it has to be a valid QName.

    If you write

    300.0
    

    then

    (a) to be namespace-well-formed, you need to declare the "xsi" namespace

    (b) to be schema-valid, you also need to declare the "xs" namespace.

    As Roberts indicated, this means you should write

    300.0
    

提交回复
热议问题