XML�}�X�^�[�ւ̓�
�`�uXML�}�X�^�[�F�x�[�V�b�N�v�����΍�`

�ŏI��@XML Schema�\�^�̍ė��p�Ɩ��O���

������F
NRI���[�j���O�l�b�g���[�N�������
2004/4/2

�@�O��u��14��@XML Schema�𗘗p�����X�L�[�}��`�v�ł́A�v�f�⑮���̐錾�A�q�v�f�����—v�f�\���icomplexType�F�����^�j�̐錾�𒆐S�ɁAXML Schema�ł̊�{�I�Ȓ�`���@��������܂����B�ŏI��ƂȂ鍡��́A�^�̍ė��p�i������g���j���ł���@�\���g���āA���[�U�[��`�P���^�i�g�ݍ��݃f�[�^�^�ɍŏ��l��ő�l�Ȃǂ̐�����݂���j�̒�`���@�ƁAXML Schema�����ł̖��O��Ԃ̗��p�A�܂����̏ꍇ��XML������XML Schema�����̊֘A�t���̕��@��������܂��B

�@�O��A�\�K���Ƃ��ĉ��L�̖����o�肵�Ă����܂����B���̖����������߂̉����������A�𓚂������܂��B

����̖��

�iQ1�j�@���̃��[�U�[��`�P���^�Ő錾����Ă���\���ɍ��v����AXML��������id�v�f�̋L�q�Ƃ��Đ������̂͂ǂ�ł��傤�B

<xs:simpleType name="restid">
  <xs:restriction base="xs:string">
      <xs:pattern value="[A-Z]{2}-\d{3}" />
  </xs:restriction>
</xs:simpleType>

<xs:element name="id" type="restid" />

�@�ia�j�@<id>AB</id>
�@�ib�j�@<id>1234</id>
�@�ic�j�@<id>AX456</id>
�@�id�j�@<id>AX-456</id>

�iQ2�j�@���̂悤�ɁA�X�L�[�}��`�Ƃ��Ė��O��ԂɊ֘A�t������XML Schema�������Q�Ƃ��Ă���XML����������܂��B����XML�������Ó��ƂȂ�XML Schema���������ׂđI�����Ă��������B

<emp:EMPLIST
 xmlns:emp="http://www.abc.com/EMP-Schema"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="http://www.abc.com/EMP-Schema empschema.xsd">
  <emp:EMPLOYEE emp:id="A001">
    <emp:NAME>Taro Yamada</emp:NAME>
  </emp:EMPLOYEE>
</emp:EMPLIST>

�ia�j
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">

<xs:element name="EMPLIST" type="EMPLIST_type" />
<xs:element name="EMPLOYEE" type="EMPLOYEE_type" />
<xs:element name="NAME" type="xs:string" />
<xs:attribute name="id" type="xs:ID" />

<xs:complexType name="EMPLIST_type">
  <xs:sequence>
    <xs:element ref="EMPLOYEE" />
  </xs:sequence>
</xs:complexType>

<xs:complexType name="EMPLOYEE_type">
  <xs:sequence>
    <xs:element ref="NAME" />
  </xs:sequence>
  <xs:attribute ref="id" use="required" />
</xs:complexType>

</xs:schema>

�ib�j
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
    targetNamespace="http://www.abc.com/EMP-Schema"
    xmlns:ns1="http://www.abc.com/EMP-Schema">

<xs:element name="EMPLIST" type="ns1:EMPLIST_type" />
<xs:element name="EMPLOYEE" type="ns1:EMPLOYEE_type" />
<xs:element name="NAME" type="xs:string" />
<xs:attribute name="id" type="xs:ID" />

<xs:complexType name="EMPLIST_type">
  <xs:sequence>
    <xs:element ref="ns1:EMPLOYEE" />
  </xs:sequence>
</xs:complexType>

<xs:complexType name="EMPLOYEE_type">
  <xs:sequence>
    <xs:element ref="ns1:NAME" />
  </xs:sequence>
  <xs:attribute ref="ns1:id" use="required" />
</xs:complexType>

</xs:schema>

�ic�j
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
    targetNamespace="http://www.abc.com/EMP-Schema"
    elementFormDefault="qualified">

<xs:element name="EMPLIST" type="EMPLIST_type" />
<xs:element name="EMPLOYEE" type="EMPLOYEE_type" />
<xs:element name="NAME" type="xs:string" />

<xs:complexType name="EMPLIST_type">
  <xs:sequence>
    <xs:element ref="EMPLOYEE" />
  </xs:sequence>
</xs:complexType>

<xs:complexType name="EMPLOYEE_type">
  <xs:sequence>
    <xs:element ref="NAME" />
  </xs:sequence>
  <xs:attribute name="id" type="xs:ID" use="required"
    form="qualified"/>
</xs:complexType>

</xs:schema>

�id�j
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
    targetNamespace="http://www.abc.com/EMP-Schema"
    xmlns:ns1="http://www.abc.com/EMP-Schema"
    elementFormDefault="qualified">

<xs:element name="EMPLIST" type="ns1:EMPLIST_type" />
<xs:element name="EMPLOYEE" type="ns1:EMPLOYEE_type" />
<xs:element name="NAME" type="xs:string" />


<xs:complexType name="EMPLIST_type">
  <xs:sequence>
    <xs:element ref="ns1:EMPLOYEE" />
  </xs:sequence>
</xs:complexType>

<xs:complexType name="EMPLOYEE_type">
  <xs:sequence>
    <xs:element ref="ns1:NAME" />
  </xs:sequence>
  <xs:attribute name="id" type="xs:ID" use="required"
    form="qualified" />
</xs:complexType>

</xs:schema>

�@����́A���̖��ɉ𓚂��邤���ŕK�v�ƂȂ鉺�L�̓��e�ɂ‚��ĉ�����܂��B

  • ���[�U�[��`�P���^�̒�`
  • XML Schema�����ł̖��O��Ԃ̗��p
    • XML Schema������XML�����̋L�q���@
    • �O���[�o���錾�ƃ��[�J���錾


�����[�U�[��`�P���^�̒�`

�@XML Schema�ł͌^���ė��p����@�\���p�ӂ���Ă���A����𗘗p�����xs:int��xs:string�ȂNJ�{�ƂȂ�f�[�^�^�ɍŏ��l��ő�l�A�������Ȃǂ̐�����݂��āA�V�����^�Ƃ��Ďg�p�ł��܂��i�u��14��@XML Schema�𗘗p�����X�L�[�}��`�v�́uXML Schema�̊T�v�@�f�[�^�^�̌n�v���Q�Ɓj�B�w�肳�ꂽ�����Ƀ}�b�`���Ȃ������͑Ó��ł͂Ȃ������ƌ��Ȃ���܂��B

�@���[�U�[��`�P���^��simpleType���g�p���Đ錾���܂��B���̂悤�ȗv�f���l���Ă݂܂��傤�B

<EMPLOYEES>
     <EMPLOYEE   id="A001">
           <Name>Taro Yamada</Name>
           <Salary>400000</Salary>
     </EMPLOYEE>
</EMPLOYEES>
���X�g1�@�]�ƈ�XML

�@Salary�v�f�͏]�ƈ��̋��^��\���A0��葽��100���~�ȉ��łȂ���΂Ȃ�܂���B���̂Ƃ��ASalary�v�f�̌^�͎��̂悤�Ȍ`�Ő錾���邱�ƂɂȂ�܂��B

 ���X�g2�@Salary�v�f�p�̃��[�U�[��`�P���^


�^�̖��O
�@name�����ł��̌^�ɖ��O��t���܂��B���̖��O�́ASALARY�v�f�̐錾�Ŏg�p����܂��B

�x�[�X�ƂȂ�^
�@������������x�[�X�ƂȂ�^���w�肵�܂��B

�������e
�@xs:restriction�v�f�̎q�v�f�Ƃ��āA�������e���`���܂��B�����͕����̎�ނ�g�ݍ��킹�Ďg���܂��B�����̎�ނƂ��ẮA���̂��̂�����܂��i�x�[�X�ƂȂ�^�ɂ���Ďg�p�ł����ނ��قȂ�j�B

�����̎�� ����
length ������
minLength �ŏ�������
maxLength �ő啶����
pattern �����p�^�[��
enumeration ���l
whiteSpace �󔒕����̐��K��
minInclusive �ŏ��l�i�w�肵���l���܂ށj
maxInclusive �ő�l�i�w�肵���l���܂ށj
minExclusive �ŏ��l�i�w�肵���l���܂܂Ȃ��j
maxExclusive �ő�l�i�w�肵���l���܂܂Ȃ��j
totalDigits �ő傯����
fractionDigits �����_�ȉ��̍ő傯����
�\1�@�q�v�f�Ƃ��Ďw��ł��鐧�����e


pattern�̎g�p��

<xs:simpleType  name="ItemCode_type">
   <xs:restriction  base="xs:string">
      <xs:pattern  value="\d{3}-[A-Z]{2}" />
   </xs:restriction>
</xs:simpleType>

�p�^�[���Ŏg�p����L��

�@

�E \d�͔C�ӂ̐�����\��
�E [A-Z]�͔͈͂�\��
�E {n}�͕������J��Ԃ����Ƃ�\��

�@�]���āA���̂悤�ȃp�^�[���̕����񂪂���Ƀ}�b�`���܂��B


enumeration�̎g�p��

<xs:simpleType  name="DeptCode_type">
   <xs:restriction  base="xs:string">
      <xs:enumeration  value="A01" />
      <xs:enumeration  value="A02" />
      <xs:enumeration  value="B01" />
      <xs:enumeration  value="B02" />
   </xs:restriction>
</xs:simpleType>

�@xs:enumeration�Ŏw�肳�ꂽ�l�����ꂼ����l�ƂȂ�܂��B�]���āA���̗�ł́uA01�v�uA02�v�uB01�v�uB02�v�̂����ꂩ�̒l���Ƃ�Ȃ���΂Ȃ�܂���B

�@�ł́A���̂悤��XML���������؂��Ă݂܂��傤�BSalary�̒l��10000000�ƂȂ��Ă���AmaxInclusive�̐����Ɉᔽ���Ă��܂��B

<?xml version="1.0" encoding="Shift_JIS" ?>
<EMPLOYEES xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:noNamespaceSchemaLocation="emp.xsd">
  <EMPLOYEE  empid="A001">
    <Name>Kazuhiko Naito</Name>
    <Salary>10000000</Salary>
  </EMPLOYEE>
</EMPLOYEES>
���X�g3�@�X�L�[�}�Ɉᔽ����XML�����ivaliderror.xml�j

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

<xs:complexType name="EMPLOYEES_type">
  <xs:sequence>
    <xs:element ref="EMPLOYEE"
                minOccurs="0" maxOccurs="unbounded"/>
  </xs:sequence>
</xs:complexType>

<xs:complexType name="EMPLOYEE_type">
  <xs:sequence >
    <xs:element ref="Name" />
    <xs:element ref="Salary" />
  </xs:sequence>
  <xs:attribute ref="empid" use="required"/>
</xs:complexType>

<xs:simpleType   name="Salary_type">
   <xs:restriction  base="xs:integer">
     <xs:minExclusive  value="0"/>
     <xs:maxInclusive  value="1000000"/>
   </xs:restriction>

</xs:simpleType>

<xs:element name="EMPLOYEES" type="EMPLOYEES_type" />
<xs:element name="EMPLOYEE" type="EMPLOYEE_type" />
<xs:element name="Name" type="xs:string"/>
<xs:element name="Salary" type="Salary_type"/>
<xs:attribute name="empid" type="xs:ID" />

</xs:schema>
���X�g4�@�]�ƈ�XML�̃X�L�[�}�iemp.xsd�j

�@�O����g�p�����X�L�[�}���؃c�[���Ō��؂��s���ƁA�}1�̂悤��Salary�ŃG���[�������������Ƃ�������܂��B

�}1�@���X�g3�̌��،��ʁi�G���[�����j�i�N���b�N�Ŋg�債�܂��j

��XML Schema�����ł̖��O��Ԃ̗��p

XML Schema������XML�����̋L�q���@

�@���X�g4�iemp.xsd�j�ŏЉ��XML Schema�����͖��O��Ԃ𗘗p���Ȃ����̂ł����B�]���āA����XML Schema�����𗘗p����XML�����i���X�g5�j�ł��AXML Schema�����Ő錾����Ă��邻�ꂼ��̗v�f�⑮���͖��O��Ԃɂ͏������Ȃ����ƂɂȂ�܂��B

<?xml version="1.0" encoding="Shift_JIS" ?>
<EMPLOYEES xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:noNamespaceSchemaLocation="emp.xsd">
  <EMPLOYEE  empid="A001">
    <Name>Kazuhiko Naito</Name>
    <Salary>400000</Salary>
  </EMPLOYEE>
</EMPLOYEES>
���X�g5�@���O��Ԃ𗘗p���Ȃ��]�ƈ�XML�iemp.xml�j

�@����ɑ΂��āA����XML Schema�����i���X�g6�j�ł́A�錾����Ă���v�f�⑮���Ȃǂ́A���O��Ԃɏ�������悤�ɂȂ�܂��B

<?xml version="1.0" encoding="Shift_JIS"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
     targetNamespace="http://www.abc.com/EMPLOYEE"      �c�c�i1�j
     xmlns:tns="http://www.abc.com/EMPLOYEE">           �c�c�i2�j

<xs:complexType name="EMPLOYEES_type">
   <xs:sequence>
       <xs:element ref="tns:EMPLOYEE"
                   minOccurs="0" maxOccurs="unbounded"/>
�@�c�i3�j
   </xs:sequence>
</xs:complexType>

<xs:complexType name="EMPLOYEE_type">
   <xs:sequence>
       <xs:element ref="tns:Name"/>
       <xs:element ref="tns:Salary"/>
   </xs:sequence>
   <xs:attribute ref="tns:empid" use="required"/>
</xs:complexType>

<xs:simpleType   name="Salary_type">
   <xs:restriction  base="xs:integer">
    <xs:minExclusive  value="0"/>
    <xs:maxInclusive  value="1000000"/>
   </xs:restriction>
</xs:simpleType>

<xs:element name="EMPLOYEES" type="tns:EMPLOYEES_type"/>�@�c�i4�j
<xs:element name="EMPLOYEE" type="tns:EMPLOYEE_type"/>
<xs:element name="Name" type="xs:string"/>
<xs:element name="Salary" type="tns:Salary_type"/>
<xs:attribute name="empid" type="xs:ID"/>

</xs:schema>
���X�g6�@���O��Ԃ𗘗p���Ă���XML Schema�����iempschema.xsd�j


�@XML Schema�����Ŗ��O��Ԃ𗘗p���Ă���Ƃ́A��`�����v�f�E�����╡���^�E���[�U�[��`�P���^���A���̖��O��Ԃɑ����邱�Ƃł��BXML�����ł����̗v�f�⑮�����g�p����ꍇ�ɂ́A���̖��O��Ԃ��g�p���Ȃ���΂Ȃ�܂����B����XML Schema�����ɍ��v����XML�����͎��̂悤�Ȍ`�ƂȂ�܂��B

<e:EMPLOYEES xmlns:e="http://www.abc.com/EMPLOYEE"�@�@�@�c�c�i5�j
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="http://www.abc.com/EMPLOYEE  empschema.xsd">
�c�c�i6�j
  <e:EMPLOYEE  e:empid="A001">
    <e:Name>Kazuhiko Naito</e:Name>
    <e:Salary>400000</e:Salary>
  </e:EMPLOYEE>
</e:EMPLOYEES>
���X�g7�@���O��Ԃ��L�q�����]�ƈ�XML�iempschema.xml�j

�@EMPLOYEES�₻�̂ق��̗v�f��empid�������A�uhttp://www.abc.com/EMPLOYEE�v�Ƃ������O��Ԃɏ������Ă��܂��B���̖��O��Ԃ����AXML Schema�����Ő錾�������O��ԂƂȂ�܂��B

XML Schema�����̋L�q�`��

�@����ł́AXML Schema�����ł̋L�q��������Ă����܂��B

�i1�jtargetNamespace="http://www.abc.com/EMPLOYEE"
�@targetNamespace�������g�p���Ė��O��Ԏ��ʎq�i���O��Ԃ̖��O�j��t���܂��B�錾�����v�f�⑮���A�����^�E�P���^���������邱�ƂɂȂ�܂��B

�i2�jxmlns:tns="http://www.abc.com/EMPLOYEE"
�i3�j<xs:element ref="tns:EMPLOYEE"�@�c�c�@/>
�i4�j<xs:element name="EMPLOYEES"
                    type="tns:EMPLOYEES_type" />

�@�錾�����v�f�⑮���A�����^�E�P���^�͖��O��Ԃɏ������܂��B���O��Ԃɏ������邱�����Q�Ƃ���ꍇ�A���O��Ԃ̐錾���s���A�v���t�B�b�N�X���w�肷��K�v������܂��i�u��13��@���O��Ԃ𗝉���DOM�̊T�v���‚����v�́u���O��ԁi�錾�Ɨ��p�j�v���Q�Ɓj�B

�@�i2�j�͂��̂��߂̖��O��Ԃ̐錾�ł������ʓI�ɂ́AtargetNamespace�ŕt�������O�̖��O��Ԃɑ΂��ăv���t�B�b�N�X��錾����`�ƂȂ�܂��B�i3�j�Ɓi4�j�̓v���t�B�b�N�X��t���ėv�f�╡���^���Q�Ƃ��Ă��܂��B�����A�i4�j�Ńv���t�B�b�N�X��t�����ɉ��L�̂悤�ɋL�q�����ꍇ�AEMPLOYEE_type�����^�͎Q�Ƃł��܂���B

<xs:element name="EMPLOYEES" type="EMPLOYEES_type"/> �c�c �G���[

�@�O�q�̌��؃c�[���Ń`�F�b�N���Ă݂�ƁA���O��Ԃɏ������Ă��Ȃ�EMPLOYEES_type���Q�Ƃł��Ȃ����߂ɃG���[���������Ă��邱�Ƃ�������܂��B

�}2�@���X�g7�̌��،��ʁi�G���[�����j�i�N���b�N�Ŋg�債�܂��j


XML�����̋L�q�`��

�@������XML�����ł̋L�q��������Ă����܂��B

�i5�jxmlns:e="http://www.abc.com/EMPLOYEE"
�@XML Schema�����Ő錾�������O��Ԃ𗘗p���邽�߂ɋL�q���܂��BXML Schema������targetNamespace�ŕt�������O�ƈ�v�����܂��B

�i6�jxsi:schemaLocation="http://www.abc.com/EMPLOYEE empschema.xsd"
�@���O��Ԃ�XML Schema�t�@�C�����֘A�t���Ă��܂��B����ɂ��AXML Schema�t�@�C�����Q�Ƃł���悤�ɂȂ�܂��B

�@��́A�v�f�⑮���Ɂi5�j�Ő錾�����v���t�B�b�N�X��t�L�����OK�ł��B

�O���[�o���錾�ƃ��[�J���錾

�@XML Schema�����ɂ�����v�f�⑮���Ȃǂ̐錾�́A�O���[�o���錾�Ƃ��Ĉ�������̂ƃ��[�J���錾�Ƃ��Ĉ�������̂�����܂��B

�O���[�o���錾
�@�@�EXML Schema�������̂����ꂩ����Q�Ɖ”\
�@�@�E���O��Ԃɏ�������

���[�J���錾
�@�@�E�L�q����Ă���͈͓��ł̂ݎQ�Ɖ”\
�@�@�E���O��Ԃɏ������Ȃ�

�@�O���[�o���錾�Ƃ��Ĉ�����̂́A���[�g�v�f�ixs:schema�j�����̎q�v�f�Ƃ��Đ錾����Ă���v�f�⑮����^�̐錾�ł��B���܂܂Ŏg�p���Ă����v�f�̒�`�i<xs:element name="XXX"�@�c�c�@/>�j�͂��ׂăO���[�o���錾�Ƃ��Ĉ����Ă������ƂɂȂ�܂��B

�@���[�J���錾�ƂȂ�̂́A���[�g�v�f�ixs:schema�j�����̎q�v�f�ł͂Ȃ��A����v�f�̎q�v�f�Ƃ��Đ錾�������̂ł��B

�@����2�‚�EMPLOYEE�v�f�̐錾������ׂĂ݂܂��傤�B

<xs:complexType name="EMPLOYEES_type">
  <xs:sequence>
    <xs:element ref="tns:EMPLOYEE"
                minOccurs="0" maxOccurs="unbounded"/>

  </xs:sequence>
</xs:complexType>
<xs:element name="EMPLOYEE" type="EMPLOYEE_type"/>
�O���[�o���錾

<xs:complexType name="EMPLOYEES_type">
  <xs:sequence>
    <xs:element name="EMPLOYEE"  type="tns:EMPLOYEE_type"
                minOccurs="0" maxOccurs="unbounded"/>

  </xs:sequence>
</xs:complexType>
���[�J���錾

�@xs:complexType�v�f�̒���<xs:element name="EMPLOYEE"�@�c�c�@/>��EMPLOYEE�v�f��錾���Ă��܂��B����́A���[�J���錾�Ƃ��Ĉ����邱�ƂɂȂ�܂��̂ŁA�ق��̏ꏊ����<xs:element ref="EMPLOYEE">�̂悤�ɎQ�Ƃ��邱�Ƃ͂ł��܂���B�����āA���[�J���錾��targetNamespace�̖��O��Ԃɏ������Ȃ��Ȃ�܂��B���̌��ʁA����ɍ��v����XML�����͎��̂悤�Ȍ`���ɂȂ��Ă��܂��܂��B

<e:EMPLOYEES xmlns:e="http://www.abc.com/EMPLOYEE"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="http://www.abc.com/EMPLOYEE   empschema2.xsd">
  <EMPLOYEE  e:empid="A001">
    <e:Name>Kazuhiko Naito</e:Name>
    <e:Salary>400000</e:Salary>
  </EMPLOYEE>
</e:EMPLOYEES>
���X�g8�@���[�J���錾�ɑΉ�������XML�����iempschema2.xml�j

<?xml version="1.0" encoding="Shift_JIS"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
     targetNamespace="http://www.abc.com/EMPLOYEE"
     xmlns:tns="http://www.abc.com/EMPLOYEE">

<xs:complexType name="EMPLOYEES_type">
  <xs:sequence >
    <xs:element  name="EMPLOYEE" type="tns:EMPLOYEE_type"
                 minOccurs="0" maxOccurs="unbounded"/>

  </xs:sequence>
</xs:complexType>

<xs:complexType name="EMPLOYEE_type">
  <xs:sequence >
    <xs:element ref="tns:Name"/>
    <xs:element ref="tns:Salary"/>
  </xs:sequence>
  <xs:attribute ref="tns:empid" use="required"/>
</xs:complexType>

<xs:simpleType   name="Salary_type">
  <xs:restriction  base="xs:integer">
    <xs:minExclusive  value="0"/>
    <xs:maxInclusive  value="1000000"/>
  </xs:restriction>
</xs:simpleType>

<xs:element name="EMPLOYEES" type="tns:EMPLOYEES_type"/>
<xs:element name="Name" type="xs:string"/>
<xs:element name="Salary" type="tns:Salary_type"/>
<xs:attribute name="empid" type="xs:ID"/>

</xs:schema>
���X�g9�@���[�J���錾���܂�XML Schema�����iempschema2.xsd�j

�@����XML Schema�����ł̃O���[�o���E���[�J���錾�̈����͎��̂悤�ɂȂ�܂��B

���[�J���錾
�@�@EMPLOYEE�v�f

�O���[�o���錾
�@�@EMPLOYEES�v�f�AName�v�f�ASalary�v�f�Aempid�����A
�@�@EMPLOYEES_type�����^�AEMPLOYEE_type�����^�A
�@�@Salary_type�P���^

�@�]���āAEMPLOYEE�v�f�݂̂��̖��O��Ԃɂ͏��������A�ق��̗v�f������E�^�錾�͂��ׂāuhttp://www.abc.com/EMPLOYEE�v�̖��O��Ԃɏ������܂��B

���[�J���錾���O���[�o�������ɂ���

�@�O�q��EMPLOYEE�v�f�̂悤��xs:schema�����̎q�v�f�ł͂Ȃ�xs:complexType�v�f���ŁA�v�f�錾���s���ƃ��[�J���Ƃ��Ĉ����Ă��܂��܂����A���̋L�q�����邱�Ƃɂ��O���[�o�������ɂł��܂��B

�@�@�i1�j���Y�錾�� form="qualified"���L�q����
�@�@�i2�jxs:schema��elementFormDefault="qualified"���L�q����

�i1�jform="qualified"���L�q����

�@�{�����[�J���錾�ƂȂ��Ă��܂��ꏊ�ɋL�q����Ă�����̂ł��Aform="qualified"���L�q����ƁA�O���[�o�������ƂȂ薼�O��Ԃɏ�������悤�ɂȂ�܂��B�O�q��EMPLOYEE�v�f���O���[�o�������ɂ���̂ł���΁A���̂悤�ȋL�q�����܂��B

<xs:complexType name="EMPLOYEES_type">
  <xs:sequence >
    <xs:element name="EMPLOYEE" type="tns:EMPLOYEE_type"
                minOccurs="0" maxOccurs="unbounded"
                form="qualified"/>

  </xs:sequence>
</xs:complexType>

�@�t�ɁA�O���[�o���錾�����[�J�������ɂ������̂ł���΁Aform="unqualified"���L�q���܂��B

�i2�jelementFormDefault="qualified"���L�q����

�@����́A�e�錾�Ɂi1�j��form="qualified"�̃f�t�H���g�l��ݒ肷����@�ł��Bxs:schema��elementFormDefault="qualified"���L�q���邱�Ƃɂ��A�i1�j�̋L�q�͕K�v�Ȃ��Ȃ�܂��B���̋L�q���A���l�̍\�����`���Ă��邱�ƂɂȂ�܂��B

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
     targetNamespace="http://www.abc.com/EMPLOYEE"
     xmlns:tns="http://www.abc.com/EMPLOYEE"
     elementFormDefault="qualified">

<xs:complexType name="EMPLOYEES_type">
  <xs:sequence >
    <xs:element name="EMPLOYEE"  type="tns:EMPLOYEE_type"
                minOccurs="0" maxOccurs="unbounded"/>

  </xs:sequence>
</xs:complexType>

�@�ȉ��ȗ�

�@XML Schema�����������I�ɐ�������悤�ȃc�[���ł́A�i2�j�̃p�^�[���ŏo�͂�����̂������悤�ł��B


��
����̖��̉�

�@����ł́A�\�K���̉𓚂ł��B

�iQ1�j�@���̃��[�U�[��`�P���^�Ő錾����Ă���\���ɍ��v����AXML��������id�v�f�̋L�q�Ƃ��Đ������̂͂ǂ�ł��傤�B

<xs:simpleType name="restid">
  <xs:restriction base="xs:string">
      <xs:pattern value="[A-Z]{2}-\d{3}" />
  </xs:restriction>
</xs:simpleType>

<xs:element name="id" type="restid" />

�@�����́A�id�j�ł��B

�@string�^�̃f�[�^�ɕ����p�^�[���̐����������Ă��܂��B�|�C���g�͎��̂Ƃ���ł��B

  • [ ]�F�͈�
  • { }�F�J��Ԃ��ďo��
  • \d�F����

�@�]���āAA�`Z�̊Ԃ̕�����2�‘����A���̌�Ɂ|�i�n�C�t���j�A�Ō�ɐ�����3�‘��������p�^�[�����K�v�ł��B���̖��Ɋւ��ĎQ�l�ɂȂ����́A�u���[�U�[��`�P���^�̒�`�v�ł��B

�iQ2�j�@���̂悤�ɁA�X�L�[�}��`�Ƃ��Ė��O��ԂɊ֘A�t������XML Schema�������Q�Ƃ��Ă���XML����������܂��B����XML�������Ó��ƂȂ�XML Schema���������ׂđI�����Ă��������B

<emp:EMPLIST
 xmlns:emp="http://www.abc.com/EMP-Schema"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="http://www.abc.com/EMP-Schema empschema.xsd">
  <emp:EMPLOYEE emp:id="A001">
    <emp:NAME>Taro Yamada</emp:NAME>
  </emp:EMPLOYEE>
</emp:EMPLIST>

�@�����́A�ib�j�Ɓid�j�ł��B

�@����XML�����Ŏg�p����Ă���v�f�E�����͂��ׂāuhttp://www.abc.com/EMP-Schema�v�̖��O��Ԃɏ������Ă��܂��B���Ȃ킿�AXML Schema�������l�����ꍇ�A�O���[�o�������ɂ��Ȃ���΂Ȃ�Ȃ��Ƃ������Ƃł��B

�@�ia�j�͖��O��Ԃ��܂������l������Ă��܂���B�ic�j��elementFormDefault="qualified"�̋L�q������̂ł����A�����^��v�f���Q�Ƃ���Ƃ��ɖ��O��Ԃ��l������Ă��܂���B

�@�ib�j�́A�v�f�⑮���A�����^�̐錾�͂��ׂ�xs:schema�����̎q�v�f�Ƃ��ċL�q����Ă��܂��̂ŁA�O���[�o���ł��薼�O��Ԃɏ������܂��B�������Q�Ƃ���ꍇ�����O��Ԃ̃v���t�B�b�N�X���g�p���Ă��܂��̂Ŗ�肠��܂���B

�@�id�j�ł́AelementFormDefault="qualified"���L�q���Ă��܂��̂ŁA�v�f�̐錾�̓O���[�o���ł���A���O��Ԃɏ������܂��B�������A���̋L�q�͑����ɑ΂��Ă͖����ł��B�]���āAid�����̐錾�ł�form="qualified"���w�肳��Ă��܂��B�܂��A�����p�ɂ�elementFormDefault�Ɠ����ړI�Ƃ��Ă�attributeFormDefault������܂��B�����̐錾�̕�����form="qualified"���L�q�������ɁAxs:schema��attributeFormDefault="qualified"���L�q���Ă�OK�ł��B

�@���̖��Ɋւ��ĎQ�l�ɂȂ����́A�uXML Schema�����ł̖��O��Ԃ̗��p���O���[�o���錾�ƃ��[�J���錾�v�ł��B

��

����ŁwXML�}�X�^�[�ւ̓��@�`�uXML�}�X�^�[�F�x�[�V�b�N�v�����΍�`�x�̘A�ڂ͊����ł��B�����Ԃ����ǂ��������A���肪�Ƃ��������܂����B�i�ҏW�ǁj


���܂Ƃ߃m�[�g�FXML Schema�𗘗p�����X�L�[�}��`

������̎����΍�̃|�C���g

  • ���[�U�[��`�P���^�̒�`
  • XML Schema�����ł̖��O��Ԃ̗��p
    • XML Schema������XML�����̋L�q���@
    • �O���[�o���錾�ƃ��[�J���錾

������̊w�K���e�ŏo��͈͂ƂȂ�d�l

������̊w�K���e�ŎQ�l�ɂȂ���IT�̋L��

������̊w�K���e�ŎQ�l�ɂȂ�XML�p��W �i��IT XML�p�ꎖ�T���j

 

Index
�A�ځFXML�}�X�^�[�ւ̓�
  �i1�jXML�}�X�^�[�F�x�[�V�b�N�����̃��x���́H
  �i2�jXML�̊T�v�ƋN���A�֘A�K�i
  �i3�jXML�����̗v�f�A�G���R�[�f�B���O�A�錾
  �i4�j���ׂĂ�XM�����͐��`���ł���
  �i5�jvalid XML��DTD�̊֌W
�@ �i6�j�͋[���FXML�̊�{
�@ �i7�j�͋[���FW3C XML Schema
  �i8�j�͋[���FDOM
  �i9�jDTD�̎��̐錾�ƋL�@�錾
  �i10�jXSLT�̊�{�\���𗝉�����
  �i11�jXSLT�ŕK�{�̐��䖽�߂��o����
  �i12�jXPath�ɂ��m�[�h�̎w��@�𗝉�����
  �i13�j���O��Ԃ𗝉���DOM�̊T�v���‚���
  �i14�jXML Schema�𗘗p�����X�L�[�}��`
�i�ŏI��jXML Schema�\�^�̍ė��p�Ɩ��O���



�A�ځFXML�}�X�^�[�ւ̓�


XML & SOA �t�H�[���� �V���L��
��IT���[���}�K�W���@�V������X�^�b�t�̃R���������[���œ͂��܂��i�����j

���ڂ̃e�[�}

HTML5�{UX �L�������L���O

�{������