7
これはただのタイプを宣言しfoo.xsd
の私の既存のXSDスキーマ、次のとおりです。XSDタイプをルートスキーマにインポートする方法は?
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0"
targetNamespace="foo">
<xs:complexType name="alpha">
<!-- skipped -->
</xs:complexType>
</xs:schema>
これは、要素を宣言して別のスキーマ、次のとおりです。
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0"
targetNamespace="foo">
<xs:import schemaLocation="foo.xsd" namespace="foo" />
<xs:element name="RootElement" type="alpha"/>
</xs:schema>
これは私がSAXから取得していますものですJavaのパーサー:
"The namespace attribute 'foo' of an <import> element information
item must not be the same as the targetNamespace of the schema it exists in."
私は間違っていますか?
ありがとう、これは私が探していたものです! – yegor256
"tns"は "targetNamespace"と同じですか? – Line