XMLチュートリアル

XMLホーム XMLの紹介 XML使用方法 XMLツリー XML構文 XML要素 XML属性 XML名前空間 XML表示 XML HttpRequest XMLパーサー XML DOM XML XPath XML XSLT XML XQuery XML XLink XMLバリデーター XML DTD XMLスキーマ XMLサーバー XMLの例 XMLクイズ XML証明書

XML AJAX

AJAXの紹介 AJAX XMLHttp AJAXリクエスト AJAX応答 AJAXXMLファイル AJAX PHP AJAX ASP AJAXデータベース AJAXアプリケーション AJAXの例

XML DOM

DOMの紹介 DOMノード DOMアクセス DOMノード情報 DOMノードリスト DOMトラバース DOMナビゲーション DOMは値を取得します DOM変更ノード DOM削除ノード DOM置換ノード DOM作成ノード DOM追加ノード DOMクローンノード DOMの例

XPathチュートリアル

XPathの概要 XPathノード XPath構文 XPath軸 XPath演算子 XPathの例

XSLTチュートリアル

XSLTの紹介 XSL言語 XSLT変換 XSLT <テンプレート> XSLT <値> XSLT <for-each> XSLT <ソート> XSLT <if> XSLT <選択> XSLT適用 クライアント上のXSLT サーバー上のXSLT XSLT Edit XML XSLTの例

XQueryチュートリアル

XQueryの紹介 XQueryの例 XQuery FLWOR XQuery HTML XQueryの用語 XQuery構文 XQuery追加 XQuery Select XQuery関数

XML DTD

DTDの紹介 DTDビルディングブロック DTD要素 DTD属性 DTD要素と属性 DTDエンティティ DTDの例

XSDスキーマ

XSDの概要 XSDハウツー XSD <スキーマ> XSD要素 XSD属性 XSDの制限

XSDコンプレックス

XSD要素 XSDが空です XSD要素のみ XSDテキストのみ XSD混合 XSDインジケーター XSD <任意> XSD <anyAttribute> XSD置換 XSDの例

XSDデータ

XSD文字列 XSD日付 XSD数値 XSDその他 XSDリファレンス

Webサービス

XMLサービス XML WSDL XML SOAP XML RDF XML RSS

参考文献

DOMノードタイプ DOMノード DOM NodeList DOM NamedNodeMap DOMドキュメント DOM要素 DOM属性 DOMテキスト DOM CDATA DOMコメント DOM XMLHttpRequest DOMパーサー XSLT要素 XSLT / XPath関数

XMLスキーマアイテム


❮完全なXMLスキーマリファレンス

定義と使用法

スキーマ要素は、スキーマのルート要素を定義します。

要素情報

  • 親要素:なし

構文

<schema
id=ID
attributeFormDefault=qualified|unqualified
elementFormDefault=qualified|unqualified
blockDefault=(#all|list of (extension|restriction|substitution))
finalDefault=(#all|list of (extension|restriction|list|union))
targetNamespace=anyURI
version=token
xmlns=anyURI
any attributes
>

((include|import|redefine|annotation)*,(((simpleType|complexType|
group|attributeGroup)|element|attribute|notation),annotation*)*)

</schema>

Attribute Description
id Optional. Specifies a unique ID for the element
attributeFormDefault Optional. The form for attributes declared in the target namespace of this schema. The value must be "qualified" or "unqualified". Default is "unqualified". "unqualified" indicates that attributes from the target namespace are not required to be qualified with the namespace prefix. "qualified" indicates that attributes from the target namespace must be qualified with the namespace prefix
elementFormDefault Optional. The form for elements declared in the target namespace of this schema. The value must be "qualified" or "unqualified". Default is "unqualified". "unqualified" indicates that elements from the target namespace are not required to be qualified with the namespace prefix. "qualified" indicates that elements from the target namespace must be qualified with the namespace prefix
blockDefault Optional. Specifies the default value of the block attribute on element and complexType elements in the target namespace. The block attribute prevents a complex type (or element) that has a specified type of derivation from being used in place of this complex type. This value can contain #all or a list that is a subset of extension, restriction, or substitution:
  • extension - prevents complex types derived by extension
  • restriction - prevents complex types derived by restriction
  • substitution - prevents substitution of elements
  • #all - prevents all derived complex types
finalDefault Optional. Specifies the default value of the final attribute on element, simpleType, and complexType elements in the target namespace. The final attribute prevents a specified type of derivation of an element, simpleType, or complexType element. For element and complexType elements, this value can contain #all or a list that is a subset of extension or restriction. For simpleType elements, this value can additionally contain list and union:
  • extension - prevents derivation by extension
  • restriction - prevents derivation by restriction
  • list - prevents derivation by list
  • union - prevents derivation by union
  • #all - prevents all derivation
targetNamespace Optional. A URI reference of the namespace of this schema
version Optional. Specifies the version of the schema
xmlns A URI reference that specifies one or more namespaces for use in this schema. If no prefix is assigned, the schema components of the namespace can be used with unqualified references
any attributes Optional. Specifies any other attributes with non-schema namespace

例1

<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">

<xs:element name="values" type="xs:string" />

</xs:schema>

例2

この例では、http://www.w3.org/2001/XMLSchema名前空間のスキーマコンポーネント(要素名、タイプ)は修飾されておらず、https://www.w3schools.com/w3schoolsschema(mystring)のスキーマコンポーネントは修飾されています。 wscプレフィックス付き:

<?xml version="1.0"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:wsc="https://www.w3schools.com/w3shoolsschema">

<element name="fname" type="wsc:mystring"/>

</schema>

❮完全なXMLスキーマリファレンス