The element “x” in namespace “xSchema” has invalid child element “y” in namespace “xSchema”. List of possible elements expected: “y”

前端 未结 2 1701
孤街浪徒
孤街浪徒 2021-02-20 03:17

I am writing a schema for my XML validation final, and finally got everything (just about) working. But now I\'m getting the strangest error in my XML. I\'ll start by showing my

相关标签:
2条回答
  • 2021-02-20 03:28
    The element 'orders' in namespace 'OrdersSchema' 
    has invalid child element 'order' in namespace 'OrdersSchema'. 
    List of possible elements expected: 'order'. 
    

    In other words, it thinks your schema told the parser to expect a non-namespaced <order> child element, and you provided a namespaced <os:order> in the instance document.

    http://www.w3.org/TR/xmlschema-0/#NS

    0 讨论(0)
  • 2021-02-20 03:49

    Your use of

    elementFormDefault="unqualified"
    attributeFormDefault="qualified"
    

    is highly unusual, and is probably the source of the trouble. Unless you really want to do something unusual, these should be the other way around.

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