web-calculus
XML Surface Syntax
2005-04-07
This specification describes the mapping of the web-calculus
document model onto the
XML surface
syntax. The mapping provides interoperation between
web-calculus tools and XML-based tools.
The web-calculus document model is
mapped to the XML
infoset.
- web-calculus tools generate output that
existing XML-based tools can manipulate.
- Existing XML-based tools can generate output destined for an
application that uses web-calculus tools.
- The shared syntax is a usable textual encoding of the
web-calculus document model.
Not a subset
This specification maps the web-calculus document model onto the
XML infoset, but does not restrict how the resulting XML data is
represented in XML syntax. Any valid XML syntax representation
of the XML data is a valid web-calculus XML document. This
specification does not define a subset of the XML syntax.
A synthetic 'list' element surrounds the entire
representation.
For each root Node
in a Document,
a synthetic
Branch is created
for the XML representation. These synthetic root
Branches use
Name
'doc' and have an empty
Annotation.
Upon parsing of the XML representation, the root
'doc'
elements
are stripped, yielding the root
Nodes.
The Branch
Name is used as the
XML
element
Name.
The Branch
Annotation is
encoded as XML
CharData
preceding the
element
start-tag.
The Branch child
Node is encoded as
the XML
element
content.
The child Node's
Schema is encoded
in the XML
element
as an attribute with name 'schema'. The child
Node's
Annotation is
encoded as XML
CharData
following the
end-tag
of the last child
element
in the XML
element
content.
Below is a simple example of an XML encoded representation of a
web-calculus document:
<list>
<doc schema="http://example.com/project/NodeSchema">
First branch comment <branch_name>child node data</branch_name>
Root node comment
</doc>
</list>
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.
|