みんな
非常に一般的な最上位構造を記述した xsd スキーマ (cft.xsd) があります。
<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:cft="http://www.foo.com/xsd/cft" targetNamespace="http://www.foo.com/xsd/cft" elementFormDefault="qualified">
    <xsd:complexType name="dirType">
        <xsd:choice minOccurs="1" maxOccurs="unbounded">
            <xsd:element name="dir" type="cft:dirType"/>
            <xsd:element name="txt">
                <xsd:complexType>
                    <xsd:simpleContent>
                        <xsd:extension base="xsd:string">
                            <xsd:attribute name="Name" use="required">
                                <xsd:simpleType>
                                    <xsd:restriction base="xsd:string">
                                        <xsd:pattern value="[0-9a-zA-Z_]+\.txt"/>
                                    </xsd:restriction>
                                </xsd:simpleType>
                            </xsd:attribute>
                        </xsd:extension>
                    </xsd:simpleContent>
                </xsd:complexType>
            </xsd:element>
            <xsd:element name="xml">
                <xsd:complexType>
                    <xsd:sequence maxOccurs="1" minOccurs="1">
                        <xsd:any/>
                    </xsd:sequence>
                    <xsd:attribute name="Name" use="required">
                        <xsd:simpleType>
                            <xsd:restriction base="xsd:string">
                                <xsd:pattern value="[0-9a-zA-Z_]+\.xml"/>
                            </xsd:restriction>
                        </xsd:simpleType>
                    </xsd:attribute>
                </xsd:complexType>
            </xsd:element>
        </xsd:choice>
    </xsd:complexType>
    <xsd:element name="root" type="cft:dirType"/>
</xsd:schema>
<cft:xml> ノードに必要なコンテンツを記述する 2 つ目のスキーマ (dictionary.xsd):
<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:l="http://www.foo.com/xsd/dictionary" xmlns:cft="http://www.foo.com/xsd/cft" targetNamespace="http://www.foo.com/xsd/dictionary" elementFormDefault="qualified">
  <xsd:element name="root">
    <xsd:simpleType>
      <xsd:attribute name="Version" type="xsd:string" use="required"/>
    </xsd:simpleType>
  </xsd:element>
</xsd:schema>
したがって、ドキュメントは次のようになります。
<cft:root xmlns:cft="http://www.foo.com/xsd/cft" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.foo.com/xsd/cft cft.xsd">
    <cft:xml Name="dictionary.xml">
        <root xmlns="http://www.foo.com/xsd/dictionary" Version="17.0"/>
    </cft:xml>
</cft:root>
私の質問は次のとおりです。 1. Dictionary.xsd で、そこで定義されている <root> 要素を <cft:xml> 要素でのみネストできるように指定するにはどうすればよいですか - それは <cft:root> 要素の子です - Name属性は "dictionary.xml"です。
前もって感謝します!