Unique constraint in XML Schema

前端 未结 2 815
故里飘歌
故里飘歌 2020-12-16 13:46

Let\'s say I have following XML file:


   a1
   a2
   2010         


        
2条回答
  •  生来不讨喜
    2020-12-16 14:18

    The selector XPath selects the nodes that must be unique (in that case, it should select the author nodes).

    The field XPath selects what "makes them unique" (in that case, using . will cause their typed value, in that case the text between the tags, treated as a string, to be used).

    The document

    
    
      a1
      a2
      2010-01-01
    
    

    should be valid against the following schema:

    
    
      
        
          
            
            
          
        
        
          
          
        
      
    
    

    while this one should not:

    
    
      a1
      a1
      2010-01-01
    
    

提交回复
热议问题