/[svn]/web/manual/namespaces.xml
ViewVC logotype

Diff of /web/manual/namespaces.xml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 556 by abate, Tue Jul 10 17:44:21 2007 UTC revision 557 by abate, Tue Jul 10 17:44:24 2007 UTC
# Line 33  Line 33 
33  </p>  </p>
34    
35  <sample>  <sample>
36  &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"/>
37  </sample>  </sample>
38    
39  <p>  <p>
# Line 41  Line 41 
41  </p>  </p>
42    
43  <sample>  <sample>
44    namespace p = "http://a.com" in
45    namespace q = "http://b.com" in
46    &lt;p:a q:c="3">[]
47    </sample>
48    
49    <p>
50    This element can be bound to a variable
51    <code>x</code> by a <code>let</code> binding as follows
52    </p>
53    
54    <sample>
55  let x =  let x =
56    namespace p = "http://a.com" in    namespace p = "http://a.com" in
57    namespace q = "http://b.com" in    namespace q = "http://b.com" in
58    &lt;p:a q:a="3">[]    &lt;p:a q:c="3">[]
59  </sample>  </sample>
60    
61  <p>  <p>
62    In which case the namespace declarations are local to the scope
63    of the let.
64    <br></br>
65  Alternatively, it is possible to use global prefix bindings:  Alternatively, it is possible to use global prefix bindings:
66  </p>  </p>
67    
68  <sample>  <sample>
69  namespace p = "http://a.com"  namespace p = "http://a.com"
70  namespace q = "http://b.com"  namespace q = "http://b.com"
71  let x = &lt;p:a q:a="3">[]  let x = &lt;p:a q:c="3">[]
72  </sample>  </sample>
73    
74  <p>  <p>
75  Similarly, CDuce supports namespace defaulting. This is introduced  Similarly, CDuce supports namespace <i>defaulting</i>. This is introduced
76  with a local or global <code>namespace "..."</code> construction.  by a local or global <code>namespace "..."</code> construction.
77  As in the XML, default namespace applies only to tags (atoms), not  As in the XML, default namespace applies only to tags (atoms), not
78  attributes (record labels).  attributes (record labels).
79  For instance, in the expression <code>namespace "A" in &lt;x  For instance, in the expression <code>namespace "A" in &lt;x
# Line 74  Line 88 
88    
89  </box>  </box>
90    
91  <box title="Types for atom" link="types">  <box title="Types for atoms" link="types">
92    
93  <p>  <p>
94  The type <code>Atom</code> represents all the atoms, in all the  The type <code>Atom</code> represents all the atoms, in all the
# Line 95  Line 109 
109    
110  <p>  <p>
111  When used as atoms and not tags, the singleton types  When used as atoms and not tags, the singleton types
112  and ``any in namespace'' types must be prefixed by an antiquote,  and ``any in namespace'' types must be prefixed by an backquote,
113  as for atom values: <code>`p:x, `p:*, `.:*</code>.  as for atom values: <code>`p:x, `p:*, `.:*</code>.
114  </p>  </p>
115    

Legend:
Removed from v.556  
changed lines
  Added in v.557

CVS Admin">CVS Admin
ViewVC Help
Powered by ViewVC 1.1.5