Home   Info   DevZone   Wiki  
UsersWeb  |  MainWeb  |  InfoWeb  |  DevZoneWeb  |  SupportWeb
XMLRegistrySchema ] [ not logged in ] [ Web: Imported ] goto:  options
[ get info on or edit ] login or new user ] [ list of topics, hubs & nodes, or recent changes ]

RegistryPages


Registry Schema for XML


NOSHADE SIZE="1"> <TABLE WIDTH="100%" BGCOLOR="floralwhite"><TR><TD>
<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>

Im not an expert on the XML schema markup, so I don't know that all this stuff works (or will even remain in the standard). If anyone sees something wrong, mail me.

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.

<Registry>
The wrapper for RegistryML files
<Node>
A Node in the registry
<Entry>
A data Entry in the registry
<Link/>
A special node that points to another valid registry via an URL
<Null/>
Only used inside an entry to state that it is null (do we need this?)

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?):

<Null>
Special value, entry is null
String
Any valid string
Number
Any valid number (Integer, Decimal or Real)
Boolean
Either true or false
Binary
A valid binary blob (that is, string of binary data)
URI
An URL
Tuple
A term borrowed from REBOL, it can be in the range of 0.0.0 or 0.0.0.0 to 127.127.127 or 127.127.127.127. perfect for version numbers and IP's
Class
A string pointer to a valid class name (i.e. org.jos.util.Factory)

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).


Good, glad you agree with a null entry. And dont worry the schema defined here only allows one of the defined datatypes or the explicit null tag to be placed in an Entry tag. --DigiGod 99.07.06


Content of these pages are owned and copyrighted by the poster.
Hosted by: