Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Xml 在XSD中引用其他架构时,属性无效_Xml_Validation_Intellij Idea_Xsd_Xml Namespaces - Fatal编程技术网

Xml 在XSD中引用其他架构时,属性无效

Xml 在XSD中引用其他架构时,属性无效,xml,validation,intellij-idea,xsd,xml-namespaces,Xml,Validation,Intellij Idea,Xsd,Xml Namespaces,我有两种模式: <schema xmlns:foo="urn:x:foo:1.0" xmlns:bar="urn:x:bar:1.0" targetNamespace="urn:x:foo:1.0" version="1.0" xmlns="http://www.w3.org/2001/XMLSchema"> <element name="bar" type="bar:bar" /> </schema>

我有两种模式:

<schema xmlns:foo="urn:x:foo:1.0" xmlns:bar="urn:x:bar:1.0"
        targetNamespace="urn:x:foo:1.0"
        version="1.0"
        xmlns="http://www.w3.org/2001/XMLSchema">
    <element name="bar" type="bar:bar" />
</schema>
我试图将
添加到
foo.xsd
中,但没有成功


这是IntelliJ中的错误还是我遗漏了什么?您会推荐任何(最好是在线)能够处理多个XSD文件的XML验证器吗?

我发现这可能是一个问题,因为我可以使用xmllint进行验证(我需要添加


也许一个解决方法是定义扩展bar:bar的复杂类型foo:bar-这种方式似乎对IntelliJ有效。

我发现这可能是一个,因为我可以使用xmllint验证这一点(我需要添加


也许一种解决方法是定义扩展bar:bar的复杂类型foo:bar-这种方法似乎对IntelliJ有效。

xs:import是必要的。您可以尝试在xs:import上添加schemaLocation属性-这是可选的,但某些XML处理器没有用于将命名空间解析为架构位置的默认实体解析器。

xs:import是必需的。您可以尝试在xs:import上添加schemaLocation属性-这是可选的,但某些XML处理器没有用于将命名空间解析为架构位置的默认实体解析器。

IntelliJ IDEA具有内置映射器。IntelliJ IDEA具有内置映射器。
<schema xmlns:bar="urn:x:bar:1.0"
        targetNamespace="urn:x:bar:1.0"
        version="1.0"
        xmlns="http://www.w3.org/2001/XMLSchema">
    <complexType name="bar">
        <attribute name="goo" type="string" />
    </complexType>
    <element name="bar" type="bar:bar"/>
</schema>
<bar goo="xxx" xmlns="urn:x:bar:1.0" />
<bar goo="xxx" xmlns="urn:x:foo:1.0" />