<?xml version='1.0'?>

<!-- XML schema for XGMML 1.0 -->
<!-- Authors: John Punin and Mukkai Krishnamoorthy -->
<!-- Computer Science Department -->
<!-- Rensselaer Polytechnic Institute -->
<!-- xgmml.xsd,v 1.0 10/06/2000 -->

<!DOCTYPE schema PUBLIC "-//W3C//DTD XMLSCHEMA 200010//EN" "http://www.w3.org/2000/10/XMLSchema.dtd" [
<!ATTLIST schema xmlns:xml CDATA #IMPLIED
		 xmlns:xlink CDATA #IMPLIED
		 xmlns:xgmml CDATA #IMPLIED> 
                 <!-- keep this schema XML1.0 valid -->
]>

<schema xmlns="http://www.w3.org/2000/10/XMLSchema" 
	targetNamespace="http://www.cs.rpi.edu/XGMML" 
	xmlns:xml="http://www.w3.org/XML/1998/namespace"
	xmlns:xlink="http://www.w3.org/1999/xlink"
	xmlns:xgmml="http://www.cs.rpi.edu/XGMML" 
	elementFormDefault="unqualified"
	attributeFormDefault="unqualified"
	version="xgmml 1.0">

<!-- get access to the xml: attribute groups for xml:lang -->
<import namespace="http://www.w3.org/XML/1998/namespace" 
	schemaLocation="http://www.w3.org/2000/10/xml.xsd"/>

<!-- Boolean type -->
<simpleType name="xgmml:boolean.type">
 <restriction base="nonNegativeInteger">
	  <enumeration value="0"/>
	  <enumeration value="1"/>
 </restriction>
</simpleType>

<!-- Positive number type -->
<simpleType name="xgmml:number.type">
  <restriction base="nonNegativeInteger"/>
</simpleType>

<!-- String type -->
<simpleType name="xgmml:string.type">
  <restriction base="string"/>
</simpleType>

<!-- URI type -->
<simpleType name="xgmml:uri.type">
  <restriction base="uriReference"/>
</simpleType>

<!-- Anchor type -->
<simpleType name="xgmml:anchor.type">
  <restriction base="NMTOKEN">
	  <enumeration value="c"/>
	  <enumeration value="n"/>
	  <enumeration value="ne"/>
	  <enumeration value="e"/>
	  <enumeration value="se"/>
	  <enumeration value="s"/>
	  <enumeration value="sw"/>
	  <enumeration value="w"/>
	  <enumeration value="nw"/>
  </restriction>
</simpleType>

<!-- Graphics Type  -->
<simpleType name="xgmml:type-graphics.type">
  <restriction base="NMTOKEN">

<!-- Type of Graphics (GML types) type-graphics-gml.type -->
	  <enumeration value="arc"/>
	  <enumeration value="bitmap"/>
	  <enumeration value="image"/>
	  <enumeration value="line"/>
	  <enumeration value="oval"/>
	  <enumeration value="polygon"/>
	  <enumeration value="rectangle"/>
	  <enumeration value="text"/>

<!-- Type of Graphics (New types) type-graphics-app.type -->
	  <enumeration value="box"/>
	  <enumeration value="circle"/>
	  <enumeration value="ver_ellipsis"/>
	  <enumeration value="hor_ellipsis"/>
	  <enumeration value="rhombus"/>
	  <enumeration value="triangle"/>
	  <enumeration value="pentagon"/>
	  <enumeration value="hexagon"/>
	  <enumeration value="octagon"/>
   </restriction>
</simpleType>

<!-- Line types -->
<!-- Arrow type -->
<simpleType name="xgmml:arrow.type">
  <restriction base="NMTOKEN">
	  <enumeration value="none"/>
	  <enumeration value="first"/>
	  <enumeration value="last"/>
	  <enumeration value="both"/>
  </restriction>
</simpleType>

<!-- Capstyle type -->
<simpleType name="xgmml:capstyle.type">
   <restriction base="NMTOKEN">
	  <enumeration value="butt"/>
	  <enumeration value="projecting"/>
	  <enumeration value="round"/>
   </restriction>
</simpleType>

<!-- Joinstyle type -->
<simpleType name="xgmml:joinstyle.type"> 
   <restriction base="NMTOKEN">
	  <enumeration value="bevel"/>
	  <enumeration value="miter"/>
	  <enumeration value="round"/>
   </restriction>
</simpleType>

<!-- Arc style  type -->
<simpleType name="xgmml:arcstyle.type"> 
   <restriction base="NMTOKEN">
	  <enumeration value="pieslice"/>
	  <enumeration value="chord"/>
	  <enumeration value="arc"/>
   </restriction>
</simpleType>

<!-- Text types -->
<!-- Text justification type -->
<simpleType name="xgmml:justify.type">
   <restriction base="NMTOKEN">
	  <enumeration value="left"/>
	  <enumeration value="right"/>
	  <enumeration value="center"/>
   </restriction>
</simpleType>

<!-- Font type -->
<simpleType name="xgmml:font.type">
  <restriction base="string"/>
</simpleType>

<!-- Color type -->
<simpleType name="xgmml:color.type"> 
   <restriction base="string"/>
</simpleType>

<!-- Angle type -->
<!-- Number followed by unit identifier (deg, grad or rad)  -->
<simpleType name="xgmml:angle.type">
   <restriction base="string">
	  <pattern value="(\+|-)?\d*(deg|grad|rad)?"/>
   </restriction>
</simpleType>

<!-- Object type -->
<simpleType name="xgmml:object.type"> 
   <restriction base="NMTOKEN">
	  <enumeration value="list"/>
	  <enumeration value="string"/>
	  <enumeration value="real"/>
	  <enumeration value="integer"/>
   </restriction>
</simpleType>

<!-- Global Attributes -->
<attributeGroup name="xgmml:global-atts">
		<attribute name="xgmml:id" type="xgmml:number.type"/>
		<attribute name="xgmml:name" type="xgmml:string.type"/>
		<attribute name="xgmml:label" type="xgmml:string.type"/>
		<attribute name="xgmml:labelanchor" type="xgmml:string.type"/>
</attributeGroup>

<!-- Standard XML Attributes -->
<attributeGroup name="xgmml:xml-atts">
		<attribute name="xmlns" type="string" use="fixed"
		           value="http://www.cs.rpi.edu/XGMML"/>
		<attributeGroup ref="xml:lang"/>
		<attributeGroup ref="xml:space"/>
</attributeGroup>

<!-- Standard XLink Attributes -->
<!-- XLink type values -->
<simpleType name="xgmml:xlink.type">
   <restriction base="NMTOKEN">
	  <enumeration value="simple"/>
	  <enumeration value="extended"/>
	  <enumeration value="locator"/>
	  <enumeration value="arc"/>
   </restriction>
</simpleType>

<!-- XLink show values -->
<simpleType name="xgmml:xlink.show"> 
   <restriction base="NMTOKEN">
	  <enumeration value="new"/>
	  <enumeration value="embed"/>
	  <enumeration value="replace"/>
   </restriction>
</simpleType>

<!-- XLink actuate values -->
<simpleType name="xgmml:xlink.actuate"> 
   <restriction base="NMTOKEN">
	  <enumeration value="onLoad"/>
	  <enumeration value="onRequest"/>
   </restriction>
</simpleType>

<!-- Attributes of XLink -->
<attributeGroup name="xgmml:xlink-atts">
		<attribute name="xmlns:xlink" type="string" use="fixed"
		           value="http://www.w3.org/1999/xlink"/>
		<attribute name="xlink:type" type="xgmml:xlink.type"
		           use="default" value="simple"/>
		<attribute name="xlink:role" type="string"/>
		<attribute name="xlink:title" type="string"/>
		<attribute name="xlink:show" type="xgmml:xlink.show" 
		           use="default" value="replace"/>
		<attribute name="xlink:actuate" type="xgmml:xlink.actuate" 
		           use="default" value="onRequest"/>
		<attribute name="xlink:href" type="xgmml:uri.type"/>
</attributeGroup>

<!-- Safe Graph Attributes -->
<attributeGroup name="xgmml:graph-atts-safe">
		<attribute name="xgmml:directed" type="xgmml:boolean.type" 
                           use="default" value="0"/>
</attributeGroup>

<!-- Unsafe Graph Attributes (GML) -->
<attributeGroup name="xgmml:graph-atts-gml-unsafe">
		<attribute name="xgmml:Vendor" type="xgmml:string.type"/>
</attributeGroup>

<!-- Unsafe Graph Attributes (new attributes) (Graphics attributes) -->
<attributeGroup name="xgmml:graph-atts-app-unsafe-gr">
		<attribute name="xgmml:Scale" type="integer"/>
		<attribute name="xgmml:Layout" type="xgmml:string.type"/>
		<attribute name="xgmml:Graphic" type="xgmml:boolean.type"/>
</attributeGroup>

<!-- Unsafe Graph Attributes (new attributes) (Structural attributes) -->
<attributeGroup name="xgmml:graph-atts-app-unsafe-ngr">
		<attribute name="xgmml:Rootnode" type="xgmml:number.type"/>
</attributeGroup>

<!-- Simple Graph (Structural graph) -->
<complexType name="xgmml:simpleGraph">
   <sequence>
      <element ref="xgmml:att" minOccurs="0" maxOccurs="unbounded"/>
      <choice minOccurs="0" maxOccurs="unbounded"> 
            <element ref="xgmml:node"/>
	    <element ref="xgmml:edge"/>
      </choice>
      <element ref="xgmml:att" minOccurs="0" maxOccurs="unbounded"/>
   </sequence>
      <attributeGroup ref="xgmml:global-atts"/>
      <attributeGroup ref="xgmml:xml-atts"/>
      <attributeGroup ref="xgmml:xlink-atts"/>
      <attributeGroup ref="xgmml:graph-atts-safe"/>
      <attributeGroup ref="xgmml:graph-atts-gml-unsafe"/>
      <attributeGroup ref="xgmml:graph-atts-app-unsafe-ngr"/>
</complexType>

<!-- Graphical Graph "is a" Simple Graph -->
<complexType name="xgmml:graphicGraph">
   <complexContent>
     <extension base="xgmml:simpleGraph"> 
       <attributeGroup ref="xgmml:graph-atts-app-unsafe-gr"/>
     </extension>
   </complexContent>
</complexType>

<!-- Graph Element -->
<element name="xgmml:graph" type="xgmml:graphicGraph"/>

<!-- Safe Node Attributes (GML) -->
<attributeGroup name="xgmml:node-atts-gml-safe">
		<attribute name="xgmml:edgeanchor" type="xgmml:string.type"/>
</attributeGroup>

<!-- Safe Node Attributes (new attributes) -->
<attributeGroup name="xgmml:node-atts-app-safe">
		<attribute name="xgmml:weight" type="xgmml:string.type"/>
</attributeGroup>

<!-- Simple Node (Structural Node) -->
<complexType name="xgmml:simpleNode">
   <sequence>
      <element ref="xgmml:att" minOccurs="0" maxOccurs="unbounded"/>
   </sequence>
      <attributeGroup ref="xgmml:global-atts"/>
      <attributeGroup ref="xgmml:xlink-atts"/>
      <attributeGroup ref="xgmml:node-atts-app-safe"/>
</complexType>

<!-- Graphical Node "is a" Simple Node -->
<complexType name="xgmml:graphicNode"> 
  <complexContent>
    <extension base="xgmml:simpleNode">
       <sequence>
          <element ref="xgmml:graphics" minOccurs="0"/>
       </sequence>
      <attributeGroup ref="xgmml:node-atts-gml-safe"/>
    </extension>
  </complexContent>
</complexType>

<!-- Node Element -->
<element name="xgmml:node" type="xgmml:graphicNode"/>

<!-- Safe Edge Attributes (GML) -->
<attributeGroup name="xgmml:edge-atts-gml-safe">
    <attribute name="xgmml:source" type="xgmml:number.type" use="required"/>
    <attribute name="xgmml:target" type="xgmml:number.type" use="required"/>
</attributeGroup>

<!-- Safe Edge Attributes (new attributes) -->
<attributeGroup name="xgmml:edge-atts-app-safe">
		<attribute name="xgmml:weight" type="xgmml:string.type"/>
</attributeGroup>

<!-- Simple Edge (Structural Edge) -->
<complexType name="xgmml:simpleEdge">
   <sequence>
      <element ref="xgmml:att" minOccurs="0" maxOccurs="unbounded"/>
   </sequence>
      <attributeGroup ref="xgmml:global-atts"/>
      <attributeGroup ref="xgmml:xlink-atts"/>
      <attributeGroup ref="xgmml:edge-atts-gml-safe"/>
      <attributeGroup ref="xgmml:edge-atts-app-safe"/>
</complexType>

<!-- Graphical Edge "is a" Simple Edge -->
<complexType name="xgmml:graphicEdge">
   <complexContent>	 
     <extension base="xgmml:simpleEdge">
       <sequence>
         <element ref="xgmml:graphics" minOccurs="0"/>
       </sequence>
     </extension>
   </complexContent>
</complexType>

<!-- Edge Element -->
<element name="xgmml:edge" type="xgmml:graphicEdge"/>

<!-- Graphics Type  -->
<attributeGroup name="xgmml:graphics-type-att">
		<attribute name="xgmml:type" type="xgmml:type-graphics.type"/>
</attributeGroup>

<!-- Point Attributes (x,y,z)  -->
<attributeGroup name="xgmml:point-atts">
		<attribute name="xgmml:x" type="double"/>
		<attribute name="xgmml:y" type="double"/>
		<attribute name="xgmml:z" type="double"/>
</attributeGroup>

<!-- Dimension Attributes (width,height,depth)  -->
<attributeGroup name="xgmml:dimension-atts">
		<attribute name="xgmml:w" type="double"/>
		<attribute name="xgmml:h" type="double"/>
		<attribute name="xgmml:d" type="double"/>
</attributeGroup>

<!-- External Attributes (Image and Bitmap)  -->
<attributeGroup name="xgmml:external-atts">
		<attribute name="xgmml:image" type="xgmml:uri.type"/>
		<attribute name="xgmml:bitmap" type="xgmml:uri.type"/>
</attributeGroup>

<!-- Line Attributes -->
<attributeGroup name="xgmml:line-atts">
		<attribute name="xgmml:width" type="xgmml:number.type"/>
		<attribute name="xgmml:arrow" type="xgmml:arrow.type"/>
		<attribute name="xgmml:capstyle" type="xgmml:capstyle.type"/>
		<attribute name="xgmml:joinstyle" type="xgmml:joinstyle.type"/>
		<attribute name="xgmml:smooth" type="xgmml:boolean.type"/>
		<attribute name="xgmml:splinesteps" type="xgmml:number.type"/>
</attributeGroup>

<!-- Text Attributes -->
<attributeGroup name="xgmml:text-atts">
		<attribute name="xgmml:justify" type="xgmml:justify.type"/>
		<attribute name="xgmml:font" type="xgmml:font.type"/>
</attributeGroup>

<!-- Bitmap Attributes -->
<attributeGroup name="xgmml:bitmap-atts">
		<attribute name="xgmml:background" type="xgmml:color.type"/>
		<attribute name="xgmml:foreground" type="xgmml:color.type"/>
</attributeGroup>

<!-- Arc Attributes -->
<attributeGroup name="xgmml:arc-atts">
		<attribute name="xgmml:extent" type="integer"/>
		<attribute name="xgmml:start" type="integer"/>
		<attribute name="xgmml:style" type="xgmml:arcstyle.type"/>
</attributeGroup>

<!-- Graphical Object Attributes -->
<attributeGroup name="xgmml:object-atts">
		<attribute name="xgmml:stipple" type="xgmml:string.type"/>
		<attribute name="xgmml:visible" type="xgmml:boolean.type"/>
		<attribute name="xgmml:fill" type="xgmml:color.type"/>
		<attribute name="xgmml:outline" type="xgmml:color.type"/>
		<attribute name="xgmml:anchor" type="xgmml:anchor.type"/>
</attributeGroup>

<!-- Graphics Element -->
<element name="xgmml:graphics">
  <complexType>
     <sequence>
     	 <choice minOccurs="0" maxOccurs="1">
	    <element ref="xgmml:Line"/>
            <element ref="xgmml:center"/>
	 </choice>
	 <element ref="xgmml:att" minOccurs="0" maxOccurs="unbounded"/>
     </sequence>
	 <attributeGroup ref="xgmml:graphics-type-att"/>
	 <attributeGroup ref="xgmml:point-atts"/>
	 <attributeGroup ref="xgmml:dimension-atts"/>
	 <attributeGroup ref="xgmml:external-atts"/>
	 <attributeGroup ref="xgmml:line-atts"/>
	 <attributeGroup ref="xgmml:text-atts"/>
	 <attributeGroup ref="xgmml:bitmap-atts"/>
	 <attributeGroup ref="xgmml:arc-atts"/>
	 <attributeGroup ref="xgmml:object-atts"/>
     </complexType>
</element>

<!-- Center Point Element -->
<element name="xgmml:center">
   <complexType>
	 <attributeGroup ref="xgmml:point-atts"/>
  </complexType>
</element>

<!-- Line Element -->
<element name="xgmml:Line">
   <complexType>
      <sequence>
	   <element ref="xgmml:point" minOccurs="2" maxOccurs="unbounded"/>
      </sequence>
   </complexType>
</element>

<!-- Point Element -->
<element name="xgmml:point">
   <complexType> 
	 <attributeGroup ref="xgmml:point-atts"/>
  </complexType>
</element>

<!-- Value Attribute -->
<attributeGroup name="xgmml:attribute-value">
		<attribute name="xgmml:value" type="xgmml:string.type"/>
</attributeGroup>

<!-- Type Attribute -->
<attributeGroup name="xgmml:attribute-type">
		<attribute name="xgmml:type" type="xgmml:object.type"/>
</attributeGroup>

<!-- Att Element -->
<element name="xgmml:att">
     <complexType mixed="true">
       <sequence>
	 <element ref="xgmml:att" minOccurs="0" maxOccurs="unbounded"/>
	 <element ref="xgmml:graph" minOccurs="0" maxOccurs="unbounded"/>
       </sequence>
	 <attributeGroup ref="xgmml:global-atts"/>
	 <attributeGroup ref="xgmml:attribute-value"/>
	 <attributeGroup ref="xgmml:attribute-value"/>
     </complexType>
</element>

</schema>




