XML Tutorial/XML Schema/whiteSpace

Материал из Web эксперт
Перейти к: навигация, поиск

whiteSpace Specifies how white space (tabs, line feeds, carriage returns, and spaces) is processed

<xsd:simpleType name="token">
  <xsd:restriction base="xsd:normalizedString">
   <xsd:whiteSpace value="collapse"/>
  </xsd:restriction>
</xsd:simpleType>


whiteSpace value="collapse"

<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
  targetNamespace="http://www.wbex.ru" xmlns="http://www.wbex.ru"
  elementFormDefault="qualified">
  <xs:simpleType name="token">
    <xs:restriction base="xs:normalizedString">
      <xs:whiteSpace value="collapse" />
    </xs:restriction>
  </xs:simpleType>
</xs:schema>


whiteSpace value="replace"

<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
  targetNamespace="http://www.wbex.ru" xmlns="http://www.wbex.ru"
  elementFormDefault="qualified">
  <xs:simpleType name="normalizedString">
    <xs:restriction base="xs:string">
      <xs:whiteSpace value="replace" />
    </xs:restriction>
  </xs:simpleType>
</xs:schema>