基于IDEA如何将自定义Schema添加到xml文档中

在学习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“。web

https://stackoverflow.com/questions/18462941/error-invalid-content-was-found-starting-with-element-x-one-of-x-is-expesvg