【XML】xmlns, XSLT, RelaxNG, JAXP, etc.【総合】
■ このスレッドは過去ログ倉庫に格納されています
0666デフォルトの名無しさん
2007/11/13(火) 20:29:25ちょっと余計なものが付くがこれで良ければ。
<xsd:element name="url" type="urlType" />
<xsd:complexType name="urlType" abstract="true" />
<xsd:complexType name="httpType">
<xsd:complexContent>
<xsd:extension base="urlType">
<xsd:sequence>
<xsd:element ref="host" />
<xsd:element ref="port" />
<xsd:element ref="path" />
</xsd:sequence>
<xsd:attribute name="scheme" type="schemeType" use="required" fixed="http" />
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexTpe name="mailtoType">(略)</xsd:complexType>
<url scheme="http" xsi:type="httpType">
<host>www.foo.com</host>
<port>80</port>
<path>/hoge/unko.txt</path>
</url>
<url scheme="mailto" xsi:type="mailtoType">(略)</url>
xsi:typeが省略されるとurlTypeはabstractなのでエラーになる。
■ このスレッドは過去ログ倉庫に格納されています