1 <?xml version="1.0" encoding="UTF-8"?>
2 <!-- $Id: config.xsd,v 1.3 2006-01-16 11:33:04 mike Exp $ -->
4 This Schema prescribes the format of YP2 configuration files.
6 xmllint -noout -schema config.xsd config1.xml
7 But use double-dashes for the option names instead of single.
8 (I couldn't include them literally, as, believe it or not,
9 it's an error to include a double dash in an XML comment.
11 <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
12 elementFormDefault="qualified"
13 targetNamespace="http://indexdata.dk/yp2/config/1"
14 xmlns:config="http://indexdata.dk/yp2/config/1">
16 <xs:element name="yp2">
19 <xs:element ref="config:start"/>
20 <xs:element ref="config:filters"/>
21 <xs:element ref="config:routes"/>
27 <xs:element name="start">
29 <!-- ### need to specify here that the element is empty -->
30 <xs:attribute name="route" use="required" type="xs:NCName"/>
35 <xs:element name="filters">
38 <xs:element maxOccurs="unbounded" ref="config:filter"/>
43 <xs:element name="filter">
46 <!-- In general, the content depends on the "type" attribute.
47 Perhaps the various filter-types' configuration
48 structures should each be described by their own little
51 <!-- type="frontend_net" -->
53 <xs:element minOccurs="0" ref="config:threads"/>
54 <xs:element ref="config:port"/>
57 <!-- type="z3950_client" -->
58 <xs:element ref="config:timeout"/>
61 <xs:element ref="config:message"/>
63 <!-- type="virt_db" -->
64 <xs:element minOccurs="0" maxOccurs="unbounded" ref="config:virtual"/>
67 <xs:attribute name="id" type="xs:NCName"/>
68 <xs:attribute name="refid" type="xs:NCName"/>
69 <xs:attribute name="type" type="xs:NCName"/>
73 <xs:element name="threads" type="xs:integer"/>
74 <xs:element name="port" type="xs:string"/>
75 <xs:element name="timeout" type="xs:integer"/>
76 <xs:element name="message" type="xs:NCName"/>
78 <xs:element name="virtual">
81 <xs:element ref="config:database"/>
82 <xs:element ref="config:target"/>
84 <xs:attribute name="route" type="xs:NCName"/>
88 <xs:element name="database" type="xs:NCName"/>
89 <xs:element name="target" type="xs:anyURI"/>
92 <xs:element name="routes">
95 <xs:element maxOccurs="unbounded" ref="config:route"/>
100 <xs:element name="route">
103 <xs:element maxOccurs="unbounded" ref="config:filter"/>
105 <xs:attribute name="id" use="required" type="xs:NCName"/>