<FONT COLOR="red"><?xml version=<FONT COLOR="orange">"1.0"</FONT>?> <!DOCTYPE schema PUBLIC <FONT COLOR="orange">'-//W3C//DTD XSDL 19990506//EN'</FONT> <FONT COLOR="orange">'http://www.w3.org/1999/05/06-xsdl/WD-xsdl.dtd'</FONT>></FONT> <FONT COLOR="purple"> <schema xmlns=<FONT COLOR="orange">"http://www.w3.org/TR/1999/WD-xdtl-19990506.xsd"</FONT> name=<FONT COLOR="orange">"http://www.jos.org/schema/jos.registry.xsd"</FONT> version=<FONT COLOR="orange">"1.0"</FONT>> <datatype name=<FONT COLOR="orange">"class"</FONT>> <basetype name=<FONT COLOR="orange">"string"</FONT> URI=<FONT COLOR="orange">"http://www.w3c.org/xmlschemas/datatypes"</FONT>> <FONT COLOR="blue"><!-- refine (with regexp's) so only valid class names can be given --></FONT> </datatype> <datatype name=<FONT COLOR="orange">"tuple"</FONT>> <basetype name=<FONT COLOR="orange">"string"</FONT> URI=<FONT COLOR="orange">"http://www.w3c.org/xmlschemas/datatypes"</FONT>> <lexicalRepresentation> <lexical> <FONT COLOR="green">([0-127].)?[0-127].[0-127].[0-127]</FONT> </lexical> </lexicalRepresentation> </datatype> <elementType name=<FONT COLOR="orange">"Null"</FONT>> <empty/> </elementType> <elementType name=<FONT COLOR="orange">"Entry"</FONT>> <choice> <datatypeRef name=<FONT COLOR="orange">"string"</FONT>/> <datatypeRef name=<FONT COLOR="orange">"number"</FONT>/> <datatypeRef name=<FONT COLOR="orange">"boolean"</FONT>/> <datatypeRef name=<FONT COLOR="orange">"binary"</FONT>/> <datatypeRef name=<FONT COLOR="orange">"uri"</FONT>/> <datatypeRef name=<FONT COLOR="orange">"tuple"</FONT>/> <datatypeRef name=<FONT COLOR="orange">"class"</FONT>/> <elementTypeRef name=<FONT COLOR="orange">"Null"</FONT> minOccur=<FONT COLOR="orange">"0"</FONT> maxOccur=<FONT COLOR="orange">"1"</FONT>/> </choice> <attrDecl name=<FONT COLOR="orange">"name"</FONT> required=<FONT COLOR="orange">"true"</FONT>> <datatypeRef name=<FONT COLOR="orange">"string"</FONT>/> </attrDecl> </elementType> <elementType name=<FONT COLOR="orange">"Link"</FONT>> <empty/> <attrDecl name=<FONT COLOR="orange">"name"</FONT> required=<FONT COLOR="orange">"true"</FONT>> <datatypeRef name=<FONT COLOR="orange">"string"</FONT>/> </attrDecl> <attrDecl name=<FONT COLOR="orange">"href"</FONT>> <datatypeRef name=<FONT COLOR="orange">"uri"</FONT>/> </attrDecl> <elementType/> <elementType name=<FONT COLOR="orange">"Node"</FONT>> <sequence> <elementTypeRef name=<FONT COLOR="orange">"Entry"</FONT> minOccur=<FONT COLOR="orange">"1"</FONT> maxOccur=<FONT COLOR="orange">"*"</FONT>/> <elementTypeRef name=<FONT COLOR="orange">"Node"</FONT> minOccur=<FONT COLOR="orange">"0"</FONT> maxOccur=<FONT COLOR="orange">"*"</FONT>/> <elementTypeRef name=<FONT COLOR="orange">"Link"</FONT> minOccur=<FONT COLOR="orange">"0"</FONT> maxOccur=<FONT COLOR="orange">"*"</FONT>/> <sequence/> <attrDecl name=<FONT COLOR="orange">"name"</FONT> required=<FONT COLOR="orange">"true"</FONT>> <datatypeRef name=<FONT COLOR="orange">"string"</FONT>/> </attrDecl> <elementType/> <elementType name=<FONT COLOR="orange">"Registry"</FONT>> <sequence> <elementTypeRef name=<FONT COLOR="orange">"Entry"</FONT> minOccur=<FONT COLOR="orange">"1"</FONT> maxOccur=<FONT COLOR="orange">"*"</FONT>/> <elementTypeRef name=<FONT COLOR="orange">"Node"</FONT> minOccur=<FONT COLOR="orange">"0"</FONT> maxOccur=<FONT COLOR="orange">"*"</FONT>/> <elementTypeRef name=<FONT COLOR="orange">"Link"</FONT> minOccur=<FONT COLOR="orange">"0"</FONT> maxOccur=<FONT COLOR="orange">"*"</FONT>/> </sequence> </elementType> </schema> </FONT>
This schema defines a simple Registry Markup to be used for JOS. It consists of 5 tags but can be used to dexribe very complex data models.
A <Registry> (or any node) must have at least one Entry so:
<TABLE BGCOLOR="floralwhite"><TR><TD>
<FONT COLOR="purple"> <FONT COLOR="red"><?xml version=<FONT COLOR="orange">"1.0"</FONT>?></FONT> <Registry> </Registry> </FONT>
is invalid.
An <Entry> cannot hold any random value, it must be of one of these types, and it must contain a value or an explicit null (do we need more/less?):
Note: I need someone familiar with RegExp's to make a filter for valid class names.
An example:
<TABLE BGCOLOR="floralwhite"><TR><TD>
<DIV ALIGN="right"><FONT COLOR="black SIZE="-1">one.reg.xml</FONT></DIV> <FONT COLOR="purple"> <FONT COLOR="red"><?xml version=<FONT COLOR="orange">"1.0"</FONT>></FONT> <Registry> <Node name=<FONT COLOR="orange">"one"</FONT>> <Entry name=<FONT COLOR="orange">"e-one"</FONT>> <FONT COLOR="green">an entry.</FONT> </Entry> <Entry name=<FONT COLOR="orange">"e-two"</FONT>> <Null/> </Entry> </Node> <Link name=<FONT COLOR="orange">"two"</FONT> href=<FONT COLOR="orange">"file:/system/two.reg.xml"</FONT>/> </Registry> <DIV ALIGN="right"><FONT COLOR="black SIZE="-1">two.reg.xml</FONT></DIV> <?xml version=<FONT COLOR="orange">"1.0"</FONT>?> <Registry> <Entry name=<FONT COLOR="orange">"e-three"</FONT>> <FONT COLOR="green">3</FONT> </Entry> </Registry> </FONT>
Those two files would create a data tree like this:
R | +-"one" | | | +-"e-one" | | "an entry." | | | +-"e-two" | <null> +-"two" | +-"e-three" '3'
-- DigiGod 99.07.05
The XML registry should support an empty entry (null), where (1) a key definitely exists and (2) has no value of any data type. Normal registry entries for set:, conf: and ini: registries look like this:
name-1=value-1 name-2=value-2 name-3=value-3
A null entry is valid, and looks like this:
name-1= name-2= name-3=
I have already used such null registry entries to build a simple list of Java keywords (for a pretty-printer servlet). -- GilbertHerschberger (6 July 1999).