<?xml version="1.0" encoding="UTF-8"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at
  
  http://www.apache.org/licenses/LICENSE-2.0
  
  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<!-- $Id: fop-intermediate-format-ng-datatypes.xsd 1835810 2018-07-13 10:29:57Z ssteiner $ -->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
  targetNamespace="http://xmlgraphics.apache.org/fop/intermediate"
  xmlns:mf="http://xmlgraphics.apache.org/fop/intermediate">
  <xs:simpleType name="colorType">
    <xs:restriction base="xs:string"/>
  </xs:simpleType>
  <xs:simpleType name="lengthType">
    <xs:restriction base="xs:int"/>
  </xs:simpleType>
  <xs:simpleType name="fontStyleType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="normal"/>
      <xs:enumeration value="italic"/>
      <xs:enumeration value="oblique"/>
      <xs:enumeration value="backslant"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="fontVariantType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="normal"/>
      <xs:enumeration value="small-caps"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="fontWeightType">
    <xs:restriction base="xs:positiveInteger">
      <xs:enumeration value="100"/>
      <xs:enumeration value="200"/>
      <xs:enumeration value="300"/>
      <xs:enumeration value="400"/>
      <xs:enumeration value="500"/>
      <xs:enumeration value="600"/>
      <xs:enumeration value="700"/>
      <xs:enumeration value="800"/>
      <xs:enumeration value="900"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="fontStretchType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="ultra-condensed"/>
      <xs:enumeration value="extra-condensed"/>
      <xs:enumeration value="condensed"/>
      <xs:enumeration value="semi-condensed"/>
      <xs:enumeration value="normal"/>
      <xs:enumeration value="semi-expanded"/>
      <xs:enumeration value="expanded"/>
      <xs:enumeration value="extra-expanded"/>
      <xs:enumeration value="ultra-expanded"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="borderStyle">
    <xs:restriction base="xs:string">
      <xs:enumeration value="none"/>
      <xs:enumeration value="hidden"/>
      <xs:enumeration value="solid"/>
      <xs:enumeration value="dotted"/>
      <xs:enumeration value="dashed"/>
      <xs:enumeration value="double"/>
      <xs:enumeration value="groove"/>
      <xs:enumeration value="ridge"/>
      <xs:enumeration value="inset"/>
      <xs:enumeration value="outset"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="ruleStyle">
    <xs:restriction base="xs:string">
      <xs:enumeration value="none"/>
      <xs:enumeration value="hidden"/>
      <xs:enumeration value="solid"/>
      <xs:enumeration value="dotted"/>
      <xs:enumeration value="dashed"/>
      <xs:enumeration value="double"/>
      <xs:enumeration value="groove"/>
      <xs:enumeration value="ridge"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="borderDef">
    <xs:restriction base="xs:string">
      <!-- TODO refine me: \w+ will not be good enough for CMYK color, for example
      <xs:pattern value="\((solid|dotted|dashed|double|groove|ridge|inset|outset),\w+,\d+(,collapse-(inner|outer))?"/>
      -->
      <xs:pattern value="\((none|hidden|solid|dotted|dashed|double|groove|ridge|inset|outset),.+\)"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="lengthListType">
    <xs:list itemType="mf:lengthType"/>
  </xs:simpleType>
  <xs:simpleType name="rectangleType">
    <xs:restriction base="mf:lengthListType">
      <xs:length value="4"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="dpListType">
    <xs:list itemType="mf:dpItemType"/>
  </xs:simpleType>
  <xs:simpleType name="dpItemType">
    <xs:union>
      <xs:simpleType>
        <xs:restriction base="mf:lengthType"/>
      </xs:simpleType>
      <xs:simpleType>
        <xs:restriction base="mf:dpZeroesType"/>
      </xs:simpleType>
    </xs:union>
  </xs:simpleType>
  <xs:simpleType name="dpZeroesType">
    <xs:restriction base="xs:string">
      <xs:pattern value="Z(\d)+"/>
    </xs:restriction>
  </xs:simpleType>
</xs:schema>
