XSD key/keyref beginner question

前端 未结 2 1987
灰色年华
灰色年华 2021-01-11 21:27

I\'m trying to implement a very simple XML schema constraint.

The idref attribute on elements of type should only be

2条回答
  •  感情败类
    2021-01-11 21:47

    Your XML document, as shown, doesn't include a schemaLocation. When an XML document doesn't reference a schema or DTD, it may pass validation simply by being well-formed XML. (This once happened to a co-worker, using a different validator. I think it's a bug that the validator didn't at least give a warning that it was missing a schema or DTD. But I digress.)

    Anyway, it should probably be something like:

    
    
      xsi:schemaLocation="test /path/to/schema/document"
        
        
         
         
    
    

提交回复
热议问题