Internal catalog files

git-svn-id: https://svn.apache.org/repos/asf/xml/commons/trunk@226060 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
ndw 2003-04-22 14:53:32 +00:00
parent 21fc7e9d1a
commit 0352b0844e
3 changed files with 580 additions and 0 deletions

149
java/etc/catalog.dtd Normal file
View File

@ -0,0 +1,149 @@
<!-- $Id$ -->
<!ENTITY % pubIdChars "CDATA">
<!ENTITY % publicIdentifier "%pubIdChars;">
<!ENTITY % partialPublicIdentifier "%pubIdChars;">
<!ENTITY % uriReference "CDATA">
<!ENTITY % string "CDATA">
<!ENTITY % systemOrPublic "(system|public)">
<!ENTITY % p "">
<!ENTITY % s "">
<!ENTITY % nsdecl "xmlns%s;">
<!ENTITY % catalog "%p;catalog">
<!ENTITY % public "%p;public">
<!ENTITY % system "%p;system">
<!ENTITY % uri "%p;uri">
<!ENTITY % rewriteSystem "%p;rewriteSystem">
<!ENTITY % rewriteURI "%p;rewriteURI">
<!ENTITY % delegatePublic "%p;delegatePublic">
<!ENTITY % delegateSystem "%p;delegateSystem">
<!ENTITY % delegateURI "%p;delegateURI">
<!ENTITY % nextCatalog "%p;nextCatalog">
<!ENTITY % group "%p;group">
<!ENTITY % local.catalog.mix "">
<!ENTITY % local.catalog.attribs "">
<!ELEMENT %catalog; (%public;|%system;|%uri;
|%rewriteSystem;|%rewriteURI;
|%delegatePublic;|%delegateSystem;|%delegateURI;
|%nextCatalog;|%group; %local.catalog.mix;)+>
<!ATTLIST %catalog;
%nsdecl; %uriReference; #FIXED
'urn:oasis:names:tc:entity:xmlns:xml:catalog'
prefer %systemOrPublic; #IMPLIED
xml:base %uriReference; #IMPLIED
%local.catalog.attribs;
>
<!ENTITY % local.public.attribs "">
<!ELEMENT %public; EMPTY>
<!ATTLIST %public;
id ID #IMPLIED
publicId %publicIdentifier; #REQUIRED
uri %uriReference; #REQUIRED
xml:base %uriReference; #IMPLIED
%local.public.attribs;
>
<!ENTITY % local.system.attribs "">
<!ELEMENT %system; EMPTY>
<!ATTLIST %system;
id ID #IMPLIED
systemId %string; #REQUIRED
uri %uriReference; #REQUIRED
xml:base %uriReference; #IMPLIED
%local.system.attribs;
>
<!ENTITY % local.uri.attribs "">
<!ELEMENT %uri; EMPTY>
<!ATTLIST %uri;
id ID #IMPLIED
name %string; #REQUIRED
uri %uriReference; #REQUIRED
xml:base %uriReference; #IMPLIED
%local.uri.attribs;
>
<!ENTITY % local.rewriteSystem.attribs "">
<!ELEMENT %rewriteSystem; EMPTY>
<!ATTLIST %rewriteSystem;
id ID #IMPLIED
systemIdStartString %string; #REQUIRED
rewritePrefix %string; #REQUIRED
%local.rewriteSystem.attribs;
>
<!ENTITY % local.rewriteURI.attribs "">
<!ELEMENT %rewriteURI; EMPTY>
<!ATTLIST %rewriteURI;
id ID #IMPLIED
uriStartString %string; #REQUIRED
rewritePrefix %string; #REQUIRED
%local.rewriteURI.attribs;
>
<!ENTITY % local.delegatePublic.attribs "">
<!ELEMENT %delegatePublic; EMPTY>
<!ATTLIST %delegatePublic;
id ID #IMPLIED
publicIdStartString %partialPublicIdentifier; #REQUIRED
catalog %uriReference; #REQUIRED
xml:base %uriReference; #IMPLIED
%local.delegatePublic.attribs;
>
<!ENTITY % local.delegateSystem.attribs "">
<!ELEMENT %delegateSystem; EMPTY>
<!ATTLIST %delegateSystem;
id ID #IMPLIED
systemIdStartString %string; #REQUIRED
catalog %uriReference; #REQUIRED
xml:base %uriReference; #IMPLIED
%local.delegateSystem.attribs;
>
<!ENTITY % local.delegateURI.attribs "">
<!ELEMENT %delegateURI; EMPTY>
<!ATTLIST %delegateURI;
id ID #IMPLIED
uriStartString %string; #REQUIRED
catalog %uriReference; #REQUIRED
xml:base %uriReference; #IMPLIED
%local.delegateURI.attribs;
>
<!ENTITY % local.nextCatalog.attribs "">
<!ELEMENT %nextCatalog; EMPTY>
<!ATTLIST %nextCatalog;
id ID #IMPLIED
catalog %uriReference; #REQUIRED
xml:base %uriReference; #IMPLIED
%local.nextCatalog.attribs;
>
<!ENTITY % local.group.mix "">
<!ENTITY % local.group.attribs "">
<!ELEMENT %group; (%public;|%system;|%uri;
|%rewriteSystem;|%rewriteURI;
|%delegatePublic;|%delegateSystem;|%delegateURI;
|%nextCatalog; %local.group.mix;)+>
<!ATTLIST %group;
id ID #IMPLIED
prefer %systemOrPublic; #IMPLIED
xml:base %uriReference; #IMPLIED
%local.group.attribs;
>

235
java/etc/catalog.rng Normal file
View File

@ -0,0 +1,235 @@
<?xml version="1.0"?>
<grammar xmlns="http://relaxng.org/ns/structure/1.0"
ns="urn:oasis:names:tc:entity:xmlns:xml:catalog"
datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
<!-- $Id$ -->
<start>
<choice>
<ref name="Catalog"/>
</choice>
</start>
<define name="pubIdChars">
<data type="string">
<param name="pattern">[a-zA-Z0-9-'()+,./:=?;!*#@$_%]*</param>
</data>
</define>
<define name="publicIdentifier">
<ref name="pubIdChars"/>
</define>
<define name="partialPublicIdentifier">
<ref name="pubIdChars"/>
</define>
<define name="systemOrPublic">
<choice>
<value>system</value>
<value>public</value>
</choice>
</define>
<define name="uriReference">
<data type="anyURI"/>
</define>
<define name="OptionalAttributes">
<optional>
<attribute name="id">
<data type="ID"/>
</attribute>
</optional>
<zeroOrMore>
<attribute>
<anyName>
<except>
<nsName ns=""/>
<nsName/>
</except>
</anyName>
</attribute>
</zeroOrMore>
</define>
<define name="PreferAttribute">
<attribute name="prefer">
<ref name="systemOrPublic"/>
</attribute>
</define>
<define name="Catalog">
<element name="catalog">
<ref name="OptionalAttributes"/>
<optional>
<ref name="PreferAttribute"/>
</optional>
<oneOrMore>
<choice>
<ref name="Group"/>
<ref name="Public"/>
<ref name="System"/>
<ref name="Uri"/>
<ref name="RewriteSystem"/>
<ref name="RewriteURI"/>
<ref name="DelegatePublic"/>
<ref name="DelegateSystem"/>
<ref name="DelegateURI"/>
<ref name="NextCatalog"/>
<ref name="AnyOtherElement"/>
</choice>
</oneOrMore>
</element>
</define>
<define name="Group">
<element name="group">
<ref name="OptionalAttributes"/>
<optional>
<ref name="PreferAttribute"/>
</optional>
<oneOrMore>
<choice>
<ref name="Public"/>
<ref name="System"/>
<ref name="Uri"/>
<ref name="RewriteSystem"/>
<ref name="RewriteURI"/>
<ref name="DelegatePublic"/>
<ref name="DelegateSystem"/>
<ref name="DelegateURI"/>
<ref name="NextCatalog"/>
<ref name="AnyOtherElement"/>
</choice>
</oneOrMore>
</element>
</define>
<define name="Public">
<element name="public">
<attribute name="publicId">
<ref name="publicIdentifier"/>
</attribute>
<attribute name="uri">
<ref name="uriReference"/>
</attribute>
<ref name="OptionalAttributes"/>
<empty/>
</element>
</define>
<define name="System">
<element name="system">
<attribute name="systemId"/>
<attribute name="uri">
<ref name="uriReference"/>
</attribute>
<ref name="OptionalAttributes"/>
<empty/>
</element>
</define>
<define name="Uri">
<element name="uri">
<attribute name="name"/>
<attribute name="uri">
<ref name="uriReference"/>
</attribute>
<ref name="OptionalAttributes"/>
<empty/>
</element>
</define>
<define name="RewriteSystem">
<element name="rewriteSystem">
<attribute name="systemIdStartString"/>
<attribute name="rewritePrefix"/>
<ref name="OptionalAttributes"/>
<empty/>
</element>
</define>
<define name="RewriteURI">
<element name="rewriteURI">
<attribute name="uriStartString"/>
<attribute name="rewritePrefix"/>
<ref name="OptionalAttributes"/>
<empty/>
</element>
</define>
<define name="DelegatePublic">
<element name="delegatePublic">
<attribute name="publicIdStartString"/>
<attribute name="catalog"/>
<ref name="OptionalAttributes"/>
<empty/>
</element>
</define>
<define name="DelegateSystem">
<element name="delegateSystem">
<attribute name="systemIdStartString"/>
<attribute name="catalog"/>
<ref name="OptionalAttributes"/>
<empty/>
</element>
</define>
<define name="DelegateURI">
<element name="delegateURI">
<attribute name="uriStartString"/>
<attribute name="catalog"/>
<ref name="OptionalAttributes"/>
<empty/>
</element>
</define>
<define name="NextCatalog">
<element name="nextCatalog">
<attribute name="catalog"/>
<ref name="OptionalAttributes"/>
<empty/>
</element>
</define>
<define name="AnyOtherElement">
<choice>
<element>
<anyName>
<except>
<nsName ns=""/>
<nsName/>
</except>
</anyName>
<zeroOrMore>
<attribute>
<anyName/>
</attribute>
</zeroOrMore>
<ref name="AnyContent"/>
</element>
<text/>
</choice>
</define>
<define name="AnyContent">
<mixed>
<zeroOrMore>
<element>
<anyName/>
<zeroOrMore>
<attribute>
<anyName/>
</attribute>
</zeroOrMore>
<zeroOrMore>
<ref name="AnyContent"/>
</zeroOrMore>
</element>
</zeroOrMore>
</mixed>
</define>
</grammar>

196
java/etc/catalog.xsd Normal file
View File

@ -0,0 +1,196 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema'
xmlns:er='urn:oasis:names:tc:entity:xmlns:xml:catalog'
targetNamespace='urn:oasis:names:tc:entity:xmlns:xml:catalog'
elementFormDefault='qualified'>
<!-- $Id$ -->
<xs:simpleType name='pubIdChars'>
<!-- A string of the characters defined as pubIdChar in production 13
of the Second Edition of the XML 1.0 Recommendation. Does not include
the whitespace characters because they're normalized by XML parsing. -->
<xs:restriction base='xs:string'>
<xs:pattern value="[a-zA-Z0-9-'()+,./:=?;!*#@$_%]*"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name='publicIdentifier'>
<xs:restriction base='er:pubIdChars'/>
</xs:simpleType>
<xs:simpleType name='partialPublicIdentifier'>
<xs:restriction base='er:pubIdChars'/>
</xs:simpleType>
<xs:simpleType name='systemOrPublic'>
<xs:restriction base='xs:string'>
<xs:enumeration value='system'/>
<xs:enumeration value='public'/>
</xs:restriction>
</xs:simpleType>
<!-- The global attribute xml:base is not explicitly declared; -->
<!-- it is allowed by the anyAttribute declarations. -->
<xs:complexType name='catalog'>
<xs:choice minOccurs='1' maxOccurs='unbounded'>
<xs:element ref='er:public'/>
<xs:element ref='er:system'/>
<xs:element ref='er:uri'/>
<xs:element ref='er:rewriteSystem'/>
<xs:element ref='er:rewriteURI'/>
<xs:element ref='er:delegatePublic'/>
<xs:element ref='er:delegateSystem'/>
<xs:element ref='er:delegateURI'/>
<xs:element ref='er:nextCatalog'/>
<xs:element ref='er:group'/>
<xs:any namespace='##other' processContents='skip'/>
</xs:choice>
<xs:attribute name='id' type='xs:ID'/>
<xs:attribute name='prefer' type='er:systemOrPublic'/>
<xs:anyAttribute namespace="##other" processContents="lax"/>
</xs:complexType>
<xs:complexType name='public'>
<xs:complexContent>
<xs:restriction base="xs:anyType">
<xs:attribute name="publicId" type="er:publicIdentifier"
use="required"/>
<xs:attribute name="uri" type="xs:anyURI" use="required"/>
<xs:attribute name='id' type='xs:ID'/>
<xs:anyAttribute namespace="##other" processContents="lax"/>
</xs:restriction>
</xs:complexContent>
</xs:complexType>
<xs:complexType name='system'>
<xs:complexContent>
<xs:restriction base="xs:anyType">
<xs:attribute name="systemId" type="xs:string"
use="required"/>
<xs:attribute name="uri" type="xs:anyURI" use="required"/>
<xs:attribute name='id' type='xs:ID'/>
<xs:anyAttribute namespace="##other" processContents="lax"/>
</xs:restriction>
</xs:complexContent>
</xs:complexType>
<xs:complexType name='uri'>
<xs:complexContent>
<xs:restriction base="xs:anyType">
<xs:attribute name="name" type="xs:anyURI"
use="required"/>
<xs:attribute name="uri" type="xs:anyURI" use="required"/>
<xs:attribute name='id' type='xs:ID'/>
<xs:anyAttribute namespace="##other" processContents="lax"/>
</xs:restriction>
</xs:complexContent>
</xs:complexType>
<xs:complexType name='rewriteSystem'>
<xs:complexContent>
<xs:restriction base="xs:anyType">
<xs:attribute name="systemIdStartString"
type="xs:string"
use="required"/>
<xs:attribute name="rewritePrefix" type="xs:string" use="required"/>
<xs:attribute name='id' type='xs:ID'/>
<xs:anyAttribute namespace="##other" processContents="lax"/>
</xs:restriction>
</xs:complexContent>
</xs:complexType>
<xs:complexType name='rewriteURI'>
<xs:complexContent>
<xs:restriction base="xs:anyType">
<xs:attribute name="uriIdStartString"
type="xs:string"
use="required"/>
<xs:attribute name="rewritePrefix" type="xs:string" use="required"/>
<xs:attribute name='id' type='xs:ID'/>
<xs:anyAttribute namespace="##other" processContents="lax"/>
</xs:restriction>
</xs:complexContent>
</xs:complexType>
<xs:complexType name='delegatePublic'>
<xs:complexContent>
<xs:restriction base="xs:anyType">
<xs:attribute name="publicIdStartString"
type="er:partialPublicIdentifier"
use="required"/>
<xs:attribute name="catalog" type="xs:anyURI" use="required"/>
<xs:attribute name='id' type='xs:ID'/>
<xs:anyAttribute namespace="##other" processContents="lax"/>
</xs:restriction>
</xs:complexContent>
</xs:complexType>
<xs:complexType name='delegateSystem'>
<xs:complexContent>
<xs:restriction base="xs:anyType">
<xs:attribute name="systemIdStartString"
type="xs:string"
use="required"/>
<xs:attribute name="catalog" type="xs:anyURI" use="required"/>
<xs:attribute name='id' type='xs:ID'/>
<xs:anyAttribute namespace="##other" processContents="lax"/>
</xs:restriction>
</xs:complexContent>
</xs:complexType>
<xs:complexType name='delegateURI'>
<xs:complexContent>
<xs:restriction base="xs:anyType">
<xs:attribute name="uriStartString"
type="xs:string"
use="required"/>
<xs:attribute name="catalog" type="xs:anyURI" use="required"/>
<xs:attribute name='id' type='xs:ID'/>
<xs:anyAttribute namespace="##other" processContents="lax"/>
</xs:restriction>
</xs:complexContent>
</xs:complexType>
<xs:complexType name='nextCatalog'>
<xs:complexContent>
<xs:restriction base="xs:anyType">
<xs:attribute name="catalog" type="xs:anyURI" use="required"/>
<xs:attribute name='id' type='xs:ID'/>
<xs:anyAttribute namespace="##other" processContents="lax"/>
</xs:restriction>
</xs:complexContent>
</xs:complexType>
<xs:complexType name='group'>
<xs:choice minOccurs='1' maxOccurs='unbounded'>
<xs:element ref='er:public'/>
<xs:element ref='er:system'/>
<xs:element ref='er:uri'/>
<xs:element ref='er:rewriteSystem'/>
<xs:element ref='er:rewriteURI'/>
<xs:element ref='er:delegatePublic'/>
<xs:element ref='er:delegateSystem'/>
<xs:element ref='er:delegateURI'/>
<xs:element ref='er:nextCatalog'/>
<xs:any namespace='##other' processContents='skip'/>
</xs:choice>
<xs:attribute name='prefer' type='er:systemOrPublic'/>
<xs:attribute name='id' type='xs:ID'/>
<xs:anyAttribute namespace="##other" processContents="lax"/>
</xs:complexType>
<xs:element name="catalog" type="er:catalog"/>
<xs:element name="public" type="er:public"/>
<xs:element name="system" type="er:system"/>
<xs:element name="uri" type="er:uri"/>
<xs:element name="rewriteSystem" type="er:rewriteSystem"/>
<xs:element name="rewriteURI" type="er:rewriteURI"/>
<xs:element name="delegatePublic" type="er:delegatePublic"/>
<xs:element name="delegateSystem" type="er:delegateSystem"/>
<xs:element name="delegateURI" type="er:delegateURI"/>
<xs:element name="nextCatalog" type="er:nextCatalog"/>
<xs:element name="group" type="er:group"/>
</xs:schema>