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

后端 未结 3 2055
余生分开走
余生分开走 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:11

    If you're on Linux, or have cygwin available on Windows, you can run the input XML through a simple sed script that will replace True with true, like so:

    cat  | sed 'sXTrueXtrueX' | xmllint --schema -
    

    If you're not, you can still use a non-validating xslt pocessor (xalan, saxon etc.) to run a simple xslt transformation on the input, and only then pipe it to xmllint.

    What the xsl should contain something like below, for the example you listed above (the xslt processor should be 2.0 capable):

    
    
        
        
        
            
                
            
        
        
    
    

提交回复
热议问题