web-calculus
www-form Surface Syntax
2003-01-24
This specification defines the mapping of the web-calculus
document model onto the
application/x-www-form-urlencoded
surface syntax. This mapping provides interoperation between
web-calculus tools and existing WWW browsers.
The [ name => value ] listing defined by the
application/x-www-form-urlencoded
syntax is treated as a [ node_path => string ] listing for specifying the contents
of a web-calculus document.
- An HTML
FORM
element can specify the content of a web-calculus document.
An HTML
FORM
describes a web-calculus document. The content of the document
is specified via individual
form controls. The
value of a form control is the value of a corresponding
Schema or
Annotation in the document. The location of the
text string within the document is specified by the form control's
control name.
The grammar for the application/x-www-form-urlencoded mapping is:
document ::= (Control ('&' Control)*)?
Control ::= ControlName '=' ControlValue
ControlName ::= (PathSegment ('-' ControlName)?) | ControlType?
PathSegment ::= Name ('.' Index)?
Index ::= [0-9]+
ControlType ::= 'node.schema' | 'node.text' | 'branch.text'
ControlValue ::= uric*
document
A document is a list of zero or more Controls,
separated by '&'.
Control
Each Control determines the value of a corresponding
Schema or
Annotation within the document. If a
Schema or
Annotation is left unspecified, it defaults to the
empty string.
ControlName
The ControlName specifies the path from the root of the document to
the location of the identified text string within the document. The path delimiter character is '-'.
PathSegment
A PathSegment specifies the
Name of the next
Branch in the path from the root of the document to the
location of the identified text string within the document. The first
PathSegment is always the synthetic 'doc' branch, used to
index the list of nodes in a web-calculus document.
Index
If a Branch
Name appears more than once within a
Node, the PathSegment MUST
additionally specify which one of the named Branches is
next in the path. Multiple Branches with the same
Name are distinguished by their order within the
Node. The optional Index gives the
relative position of the next Branch in the path.
If unspecified, the Index defaults to '0'.
ControlType
A Control encodes either: a
Schema; a
Node
Annotation; or a
Branch
Annotation.
Each of these different types of Control is distinguished by a
corresponding ControlType. The corresponding
ControlType values are 'node.schema', 'node.text', or 'branch.text'.
If a Control's ControlType is left
unspecified, it defaults to 'node.text'.
ControlValue
A ControlValue contains a URL encoded
Schema or
Annotation.
Below is a simple example of an application/x-www-form-urlencoded representation of a
web-calculus document. The example has been split onto multiple
lines for easier reading, but would be transmitted as a single line.
doc-node.schema=http%3A%2F%2Fexample.com%2Fproject%2FNodeSchema&
doc-branch_name-branch.text=First+branch+comment&
doc-branch_name=child+node+data&
doc=Root+node+comment
The document has a single root Node. The root
Node Schema
is: 'http://example.com/project/NodeSchema'. The root Node
Annotation is: 'Root node comment'. The root
Node has a single
Branch named 'branch_name', with
Annotation: 'First branch comment'. The single
Branch points to a child
Node with
Annotation: 'child node data'. The child
Node has an implicit
Schema and no
Branches.
|