Commit 47175a5c authored by Pietro Abate's avatar Pietro Abate
Browse files

[r2003-07-02 23:00:14 by cvscast] Empty log message

Original author: cvscast
Date: 2003-07-02 23:00:14+00:00
parent 6542522a
......@@ -33,33 +33,47 @@ XML documents
</p>
<sample>
&lt;p:a q:x="3" xmlns:p="http://a.com" xmlns:q="http://b.com"/>
&lt;p:a q:c="3" xmlns:p="http://a.com" xmlns:q="http://b.com"/>
</sample>
<p>
can be written in CDuce:
</p>
<sample>
namespace p = "http://a.com" in
namespace q = "http://b.com" in
&lt;p:a q:c="3">[]
</sample>
<p>
This element can be bound to a variable
<code>x</code> by a <code>let</code> binding as follows
</p>
<sample>
let x =
namespace p = "http://a.com" in
namespace q = "http://b.com" in
&lt;p:a q:a="3">[]
&lt;p:a q:c="3">[]
</sample>
<p>
In which case the namespace declarations are local to the scope
of the let.
<br></br>
Alternatively, it is possible to use global prefix bindings:
</p>
<sample>
namespace p = "http://a.com"
namespace q = "http://b.com"
let x = &lt;p:a q:a="3">[]
let x = &lt;p:a q:c="3">[]
</sample>
<p>
Similarly, CDuce supports namespace defaulting. This is introduced
with a local or global <code>namespace "..."</code> construction.
Similarly, CDuce supports namespace <i>defaulting</i>. This is introduced
by a local or global <code>namespace "..."</code> construction.
As in the XML, default namespace applies only to tags (atoms), not
attributes (record labels).
For instance, in the expression <code>namespace "A" in &lt;x
......@@ -74,7 +88,7 @@ other, the current set of global bindings.
</box>
<box title="Types for atom" link="types">
<box title="Types for atoms" link="types">
<p>
The type <code>Atom</code> represents all the atoms, in all the
......@@ -95,7 +109,7 @@ in the current default namespace.
<p>
When used as atoms and not tags, the singleton types
and ``any in namespace'' types must be prefixed by an antiquote,
and ``any in namespace'' types must be prefixed by an backquote,
as for atom values: <code>`p:x, `p:*, `.:*</code>.
</p>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment