xsd:boolean element type accept “true” but not “True”. How can I make it accept it?

后端 未结 3 2039
余生分开走
余生分开走 2020-12-15 02:20

I am using xmllint --schema option to validate my XML that looks like this


True

In my

3条回答
  •  独厮守ぢ
    2020-12-15 03:07

    You cannot.

    According to the XML Schema specification, a boolean is true or false. True is not valid:

    
      3.2.2.1 Lexical representation
      An instance of a datatype that is defined as ·boolean· can have the 
      following legal literals {true, false, 1, 0}. 
    
      3.2.2.2 Canonical representation
      The canonical representation for boolean is the set of 
      literals {true, false}. 
    

    If the tool you are using truly validates against the XML Schema standard, then you cannot convince it to accept True for a boolean.

提交回复
热议问题