XSD restriction that negates a matching string

前端 未结 2 1941
小鲜肉
小鲜肉 2021-01-23 22:33

I want my XSD to validate the contents of a string. To be specific, I want to validate that a certain string does not occur.

Consider this rule, which

2条回答
  •  Happy的楠姐
    2021-01-23 22:52

    You don't mention whether you are bound to XML Schema 1.0 and XPath 1.0, but if not it is possible to accomplish your goal with xs:assert's, along the lines of this (which may need some work - this is from memory...):

    
      
        
          
        
      
      
    

    Some links of possible interest:

    http://www.ibm.com/developerworks/library/x-xml11pt2/

    http://www.w3.org/TR/xpath-functions/#func-starts-with

    Cheers,

提交回复
热议问题