在学习XML的约束的时候,想自己规范一个约束添加到xml文档中,在xsd文件中指定了xmlns=“http://www.w3.org/2001/XMLSchema”、targetNamespace=
"http://www.test.com/teacher"以及attributeFormDefault="qualified"后,在xml的根元素中添加xmlns、xmlns:xsi、xsi:schemaLocation后,一直提示"Invalid content starting with element {teacher}.one of {teacher} is expected,经过查询发现是在xsd文件中缺少elementFormDefault=”qualified“。
版权声明:本文为sinat_33771417原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。