Java 多命名空间多架构xml未验证

Java 多命名空间多架构xml未验证,java,xml,validation,xsd,Java,Xml,Validation,Xsd,我正在尝试使用jing验证多命名空间、多模式xml。我的文件如下: testtype.xsd <?xml version="1.0" encoding="utf-8"?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.my.com/testtype" xmlns:abcs="http://www.my.com/test1"

我正在尝试使用jing验证多命名空间、多模式xml。我的文件如下:
testtype.xsd

<?xml version="1.0" encoding="utf-8"?>
 <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
        targetNamespace="http://www.my.com/testtype"
        xmlns:abcs="http://www.my.com/test1"
        xmlns:childs="http://www.my.com/childs">

 <xsd:import namespace="http://www.my.com/test1" 
       schemaLocation="abc.xsd"/>
 <xsd:import namespace="http://www.my.com/childs"
       schemaLocation="child.xsd"/>

<xsd:complexType name="testtype">
 <xsd:sequence>
   <xsd:element ref="childs:team" />
   <xsd:element ref="abcs:test"/>
 </xsd:sequence>
</xsd:complexType>
</xsd:schema>  
有人能告诉我为什么会出现空指针异常,或者xsd格式是否有问题吗


感谢

被调用产品中的NullPointerException表明该产品存在缺陷;有时这可以追溯到错误地调用产品的接口。当它是开源的时候,看看源代码会有所帮助。否则,你最好问一个特定于该产品支持的列表。@MichaelKay我在其他地方也找到了你的话。他们说这是产品错误。但是我可以假设我的xsd格式正确。不,如果产品出现故障,那么你就没有关于xsd正确性的信息。它可能会失败,因为他们错了。在不同的XSD处理器上检查它们(例如Saxon!)@MichaelKay ok。我会检查的。谢谢
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" 
targetNamespace="http://www.my.com/childs"
xmlns:why="http://www.my.com/childs">

<xs:include schemaLocation="parent.xsd" />
<xs:element name="team" type="why:baseTeam"/>
</xs:schema>  
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" 
    targetNamespace="http://www.my.com/test1" >

<xs:element name="test" type="xs:string">
</xs:element>
</xs:schema>  
<?xml version="1.0" encoding="utf-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    targetNamespace="http://www.my.com/childs"
    xmlns:whys="http://www.my.com/childs">

<xsd:include schemaLocation="grandparent.xsd" />
<xsd:complexType name="baseTeam">
 <xsd:attribute name="mascot" type="whys:mascotNames" use="required" />
</xsd:complexType>
</xsd:schema>
<?xml version="1.0" encoding="utf-8"?>
 <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
    targetNamespace="http://www.my.com/childs">

<xsd:simpleType name="mascotNames">
<xsd:restriction base="xsd:string">
  <xsd:enumeration value="bengals" />
  <xsd:enumeration value="cowboys" />
  <xsd:enumeration value="patriots" />
</xsd:restriction>
</xsd:simpleType>
</xsd:schema>  
<?xml version="1.0"?>
<testtype xmlns="http://www.my.com"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

            xsi:schemaLocation="http://www.my.com/testtype  testtype.xsd
                http://www.my.com/childs  child.xsd
                                http://www.my.com/test1 abc.xsd"
            xmlns:testtype="http://www.my.com/testtype"
                xmlns:childs="http://www.my.com/childs"
            xmlns:abcs="http://www.my.com/abcs">

<childs:team mascot="cowboys"/>
<abcs:test>statement</abcs:test>
</testtype>
Exception in thread "main" java.lang.NullPointerException
at org.apache.xerces.impl.xs.XMLSchemaLoader.resolveDocument(Unknown Source)
at org.apache.xerces.impl.xs.XMLSchemaValidator.findSchemaGrammar(Unknown Source)
at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(Unknown Source)