1 <?xml version="1.0" encoding="UTF-8"?>
2 <!-- $Id: config.xsd,v 1.4 2006-01-16 12:03:11 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 <!-- ### We 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" or type="multi" -->
64 <xs:element minOccurs="0" maxOccurs="unbounded" ref="config:virtual"/>
66 <!-- type="auth_simple" or type="backend_test" -->
67 <!-- No elements included -->
70 <xs:attribute name="id" type="xs:NCName"/>
71 <xs:attribute name="refid" type="xs:NCName"/>
72 <xs:attribute name="type" type="xs:NCName"/>
76 <xs:element name="threads" type="xs:integer"/>
77 <xs:element name="port" type="xs:string"/>
78 <xs:element name="timeout" type="xs:integer"/>
79 <xs:element name="message" type="xs:NCName"/>
81 <!-- ### This is used differently depending on whether it occurs
82 within a "virt_db" or "multi" filter: for the former, it
83 contains one database and one target; for the latter, it
84 contains an optional vhost and one or more targets. This
85 schema should be tweaked to enforce this. -->
86 <xs:element name="virtual">
89 <xs:element minOccurs="0" ref="config:database"/>
90 <xs:element minOccurs="0" ref="config:vhost"/>
91 <xs:element maxOccurs="unbounded" ref="config:target"/>
93 <xs:attribute name="route" type="xs:NCName"/>
97 <xs:element name="database" type="xs:NCName"/>
98 <xs:element name="vhost" type="xs:NCName"/>
99 <xs:element name="target" type="xs:anyURI"/>
102 <xs:element name="routes">
105 <xs:element maxOccurs="unbounded" ref="config:route"/>
110 <xs:element name="route">
113 <xs:element maxOccurs="unbounded" ref="config:filter"/>
115 <xs:attribute name="id" use="required" type="xs:NCName"/>