Newton Streamed Object Format DTD

This Document Type Definition describes XML format container for Newton Streamed Object Format data. It attempts to be strictly compatible with NSOF. XSL document and accompanying DTD are being considered to present data in more readable and compact format.

For information on NSOF please refer to the relevant section of Newton Formats document (NewtonFormats1.1.pdf, p.59). You can see example from Newton Formats document in XML form here (validate).

<!-- 
====================================================================
newtonscript.dtd
====================================================================
version: 1.0.5a
date: Sun, 10. February 2003
author: Michael Vacik <mici@simplicitas.net>

Document Type Definition for the Newton Script Object Format XML 
container.

Typical invocation:
<!DOCTYPE frame PUBLIC "-//DCL Group//Canonical DTD 1.0//EN"
    "http://www.kallisys.com/DTDs/newtonscript.dtd">

Copyright (c) 2003, Some Rights Reserved.
====================================================================
-->

Entity objects defines group of objects contained in slot or array.

<!ENTITY % objects " symbol 
                   | frame 
                   | array 
                   | int 
                   | char 
                   | nil 
                   | true 
                   | magic_ptr 
                   | weird_immediate 
                   | binary 
                   | string 
                   | precedent "
>

Frame allows zero or more slots, has optional unique id attribute. (To follow rules for XML names, and to maintain ID/IDREF functionality DCL prepends letter "n" to every id integer.)

<!ELEMENT frame (slot*) >
<!ATTLIST frame 
	id ID #IMPLIED 
>

Slot requires single object element and attribute symbol.

<!ELEMENT slot (%objects;) >
<!ATTLIST slot 
	symbol CDATA #REQUIRED
>

Class requires single object element.

<!ELEMENT class (%objects;) >

Array allows optional class followed by zero or more objects. It has optional unique attribute id.

<!ELEMENT array (class?, (%objects;)*) >
<!ATTLIST array 
	id ID #IMPLIED 
>

String contains single optional class element, and requires single value element. It has optional unique attribute id.

<!ELEMENT string (class?, value) >
<!ATTLIST string
	id ID #IMPLIED
>

Binary contains single optional class element, and requires single element value with Base64 encoded binary data. It has optional unique attribute id.

<!ELEMENT binary (class?, value) >
<!ATTLIST binary 
 	id ID #IMPLIED
>

Precedent is empty element with required attribute idref referencing unique id within the document.

<!ELEMENT precedent EMPTY >
<!ATTLIST precedent 
	idref IDREF #REQUIRED 
>

Following elements are containers for parsed character data.

<!ELEMENT symbol (#PCDATA)>

Added value to avoid mixed content in string and binary.

<!ELEMENT value (#PCDATA) >

<!ELEMENT int (#PCDATA)>

<!ELEMENT char (#PCDATA) >

<!ELEMENT magic_ptr (#PCDATA) >

<!ELEMENT weird_immediate (#PCDATA) >

Boolean nil & true elements are always empty.

<!ELEMENT nil EMPTY >

<!ELEMENT true EMPTY >