<?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-nav.xsd 746664 2009-02-22 12:40:44Z jeremias $ -->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
    elementFormDefault="qualified"
    targetNamespace="http://xmlgraphics.apache.org/fop/intermediate/document-navigation"
    xmlns:nav="http://xmlgraphics.apache.org/fop/intermediate/document-navigation"
    xmlns:if="http://xmlgraphics.apache.org/fop/intermediate">
  
  <xs:import schemaLocation="fop-intermediate-format-ng-datatypes.xsd"
    namespace="http://xmlgraphics.apache.org/fop/intermediate"/>
  
  <xs:element name="bookmark-tree">
    <xs:complexType>
      <xs:sequence minOccurs="1" maxOccurs="unbounded">
        <xs:element ref="nav:bookmark"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="bookmark">
    <xs:complexType>
      <xs:complexContent>
        <xs:extension base="nav:actionType">
          <xs:sequence>
            <xs:element ref="nav:bookmark" maxOccurs="unbounded" minOccurs="0"/>
          </xs:sequence>
          <xs:attribute name="title" type="xs:string"/>
          <xs:attribute name="starting-state">
            <xs:simpleType>
              <xs:restriction base="xs:string">
                <xs:enumeration value="show"/>
                <xs:enumeration value="hide"/>
              </xs:restriction>
            </xs:simpleType>
          </xs:attribute>
          <!-- Not yet implemented:
          <xs:attribute name="color" type="if:colorType"/>
          <xs:attribute name="font-style">
            <xs:simpleType>
              <xs:restriction base="xs:string">
                <xs:enumeration value="normal"/>
                <xs:enumeration value="italic"/>
              </xs:restriction>
            </xs:simpleType>
          </xs:attribute>
          <xs:attribute name="font-weight">
            <xs:simpleType>
              <xs:restriction base="xs:string">
                <xs:enumeration value="normal"/>
                <xs:enumeration value="bold"/>
              </xs:restriction>
            </xs:simpleType>
          </xs:attribute>
          -->
        </xs:extension>
      </xs:complexContent>
    </xs:complexType>
  </xs:element>
  
  <xs:element name="link">
    <xs:complexType>
      <xs:complexContent>
        <xs:extension base="nav:actionType">
          <xs:attribute name="rect" type="if:rectangleType"/>
        </xs:extension>
      </xs:complexContent>
    </xs:complexType>
  </xs:element>
  
  <xs:complexType name="actionType">
    <xs:choice>
      <xs:element ref="nav:goto-uri"/>
      <xs:element ref="nav:goto-xy"/>
    </xs:choice>
  </xs:complexType>
  <xs:element name="goto-uri">
    <xs:complexType>
      <xs:attributeGroup ref="nav:idAtts"/>
      <xs:attribute name="uri" type="xs:anyURI" use="required"/>
      <xs:attribute name="show-destination" use="optional" default="replace">
        <xs:simpleType>
          <xs:restriction base="xs:string">
            <xs:enumeration value="new"/>
            <xs:enumeration value="replace"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
    </xs:complexType>
  </xs:element>
  <xs:element name="goto-xy">
    <xs:complexType>
      <xs:attributeGroup ref="nav:refDef"/>
      <xs:attribute name="page-index" type="xs:int"/>
      <xs:attributeGroup ref="nav:posAtts"/>
    </xs:complexType>
  </xs:element>
  
  <xs:attributeGroup name="posAtts">
    <xs:attribute name="x" type="if:lengthType" default="0"/>
    <xs:attribute name="y" type="if:lengthType" default="0"/>
  </xs:attributeGroup>
  <xs:attributeGroup name="idAtts">
    <xs:attribute name="id" type="xs:NCName"/>
  </xs:attributeGroup>
  <xs:attributeGroup name="refDef">
    <xs:attributeGroup ref="nav:idAtts"/>
    <xs:attribute name="idref" type="xs:NCName"/>
  </xs:attributeGroup>
</xs:schema>
