XSD: How to validate the XML file according to value of some tag?

后端 未结 4 618
醉梦人生
醉梦人生 2020-12-19 11:13

I was trying to validate this XML file ... where if

  1. is \"Y\" then must appear

  2. if

4条回答
  •  温柔的废话
    2020-12-19 11:26

    It's a known fact that this is a handycap of XML schema. But I would appreciate your approach of trying the tag. It could be successful if your conditions were something like this:

    1. If is required and appears first then isn't required (and appears as second tag)
    2. If is required and appears first then isn't required (and appears as second)

    The code is:

    
      
        
          
            
              
                
                  
                  
                
                
                  
                  
                
              
            
          
        
      
    
    

提交回复
热议问题