Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cduce
cduce
Commits
c777a2ee
Commit
c777a2ee
authored
Oct 05, 2007
by
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
641543bc
Changes
1
Hide whitespace changes
Inline
Side-by-side
web/manual/namespaces.xml
View file @
c777a2ee
...
@@ -33,33 +33,47 @@ XML documents
...
@@ -33,33 +33,47 @@ XML documents
</p>
</p>
<sample>
<sample>
<
p:a q:
x
="3" xmlns:p="http://a.com" xmlns:q="http://b.com"/>
<
p:a q:
c
="3" xmlns:p="http://a.com" xmlns:q="http://b.com"/>
</sample>
</sample>
<p>
<p>
can be written in CDuce:
can be written in CDuce:
</p>
</p>
<sample>
namespace p = "http://a.com" in
namespace q = "http://b.com" in
<
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>
<sample>
let x =
let x =
namespace p = "http://a.com" in
namespace p = "http://a.com" in
namespace q = "http://b.com" in
namespace q = "http://b.com" in
<
p:a q:
a
="3">[]
<
p:a q:
c
="3">[]
</sample>
</sample>
<p>
<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:
Alternatively, it is possible to use global prefix bindings:
</p>
</p>
<sample>
<sample>
namespace p = "http://a.com"
namespace p = "http://a.com"
namespace q = "http://b.com"
namespace q = "http://b.com"
let x =
<
p:a q:
a
="3">[]
let x =
<
p:a q:
c
="3">[]
</sample>
</sample>
<p>
<p>
Similarly, CDuce supports namespace defaulting. This is introduced
Similarly, CDuce supports namespace
<i>
defaulting
</i>
. This is introduced
with
a local or global
<code>
namespace "..."
</code>
construction.
by
a local or global
<code>
namespace "..."
</code>
construction.
As in the XML, default namespace applies only to tags (atoms), not
As in the XML, default namespace applies only to tags (atoms), not
attributes (record labels).
attributes (record labels).
For instance, in the expression
<code>
namespace "A" in
<
x
For instance, in the expression
<code>
namespace "A" in
<
x
...
@@ -74,7 +88,7 @@ other, the current set of global bindings.
...
@@ -74,7 +88,7 @@ other, the current set of global bindings.
</box>
</box>
<box
title=
"Types for atom"
link=
"types"
>
<box
title=
"Types for atom
s
"
link=
"types"
>
<p>
<p>
The type
<code>
Atom
</code>
represents all the atoms, in all the
The type
<code>
Atom
</code>
represents all the atoms, in all the
...
@@ -95,7 +109,7 @@ in the current default namespace.
...
@@ -95,7 +109,7 @@ in the current default namespace.
<p>
<p>
When used as atoms and not tags, the singleton types
When used as atoms and not tags, the singleton types
and ``any in namespace'' types must be prefixed by an
anti
quote,
and ``any in namespace'' types must be prefixed by an
back
quote,
as for atom values:
<code>
`p:x, `p:*, `.:*
</code>
.
as for atom values:
<code>
`p:x, `p:*, `.:*
</code>
.
</p>
</p>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment