Commit bc5f8078 authored by Pietro Abate's avatar Pietro Abate
Browse files

[r2003-05-15 08:03:09 by cvscast] Empty log message

Original author: cvscast
Date: 2003-05-15 08:03:09+00:00
parent dfa9b4c0
......@@ -8,6 +8,92 @@
<boxes-toc/>
</left>
<box title="XML documents" link="t0">
<p>
CDuce uses its own notation to denote XML documents. In the next table we
present an XML document on the left and the same document in CDuce notation on
the right
</p>
<sample><![CDATA[
<?xml version="1.0"?>
<parentbook>
<person gender="F">
<name>Clara</name>
<children>
<person gender="M">
<name>Pål André</name>
<children/>
</person>
</children>
<email>clara@lri.fr</email>
<tel>314-1592654</tel>
</person>
<person gender="M">
<name> Bob </name>
<children>
<person gender="F">
<name>Alice</name>
<children/>
</person>
<person gender="M">
<name>Anne</name>
<children>
<person gender="M">
<name>Charlie</name>
<children/>
</person>
</children>
</person>
</children>
<tel kind="work">271828</tel>
<tel kind="home">66260</tel>
</person>
</parentbook>
]]></sample>
<sample><![CDATA[
let parents : ParentBook =
<parentbook>[
<person gender="F">[
<name>"Clara"
<children>[
<person gender="M">[
<name>['Pål ' 'André']
<children>[]
]
]
<email>['clara@lri.fr']
<tel>"314-1592654"
]
<person gender="M">[
<name>"Bob"
<children>[
<person gender="F">[
<name>"Alice"
<children>[]
]
<person gender="M">[
<name>"Anne"
<children>[
<person gender="M">[
<name>"Charlie"
<children>[]
]
]
]
]
<tel kind="work">"271828"
<tel kind="home">"66260"
]
]
]]></sample>
</box>
<box title="Type declarations" link="t1">
<p>
First, we declare some types:
......@@ -43,7 +129,7 @@ thus be:
</p>
<sample><![CDATA[
<person gender="F"|"M">[ Name Children (Tel | Email)*];;
<person gender={{"F"|"M"}}>[ Name Children (Tel | Email)*];;
]]></sample>
<p>
......@@ -53,6 +139,7 @@ A person element is composed by a sequence formed of a name element, a
children element, and zero or more telephone and e-mail elements, in this order.
</p>
<p>
Name elements contain strings. These are encoded as sequences of
characters. The PCDATA keyword is equivalent to the regexp
Char*, then String, [Char*], [PCDATA], [PCDATA* PCDATA],
......@@ -66,13 +153,14 @@ phone number is an integer with at least, say, 5 digits (of course this is
meaningful only if no phone number starts by 0) we would have used
an interval type such as &lt;tel kind=?"home"|"work"&gt;[10000- -*], where
* here denotes plus infinity.
</p>
<p>
Echar is the type of characters in e-mails
addresses. It is used in the regular expression defining Email to
precisely constrain the form of the addresses. An XML document satisfying
these constraints is shown
</p>
</box>
......
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