Author(s): Daniel Cabeza.
Version: 1.10#7 (2006/4/26, 19:22:13 CEST)
Version of last change: 1.9#253 (2003/12/30, 22:44:55 CET)
Here are defined the regular types used in the documentation of the predicates of the PiLLoW package.
pillow_types
)pillow_types
)A term representing HTML code in canonical, structured way. It is a list of terms defined by the following predicate:
canonic_html_item(comment(S)) :- string(S). canonic_html_item(declare(S)) :- string(S). canonic_html_item(env(Tag,Atts,Terms)) :- atm(Tag), list(Atts,tag_attrib), canonic_html_term(Terms). canonic_html_item($(Tag,Atts)) :- atm(Tag), list(Atts,tag_attrib). canonic_html_item(S) :- string(S).
tag_attrib(Att) :- atm(Att). tag_attrib(Att=Val) :- atm(Att), string(Val).
Each structure represents one HTML construction:
($)/2
is defined by the pillow package as an infix, binary operator.
<!--
string-->
).
<!
string>
).
For example, the term
env(a,[href="www.therainforestsite.com"], ["Visit ",img$[src="TRFS.gif"]])
is output to (or parsed from):
<a href="www.therainforestsite.com">Visit <img src="TRFS.gif"></a>
Usage: canonic_html_term(HTMLTerm)
HTMLTerm
is a term representing HTML code in canonical form.
A term representing XML code in canonical, structured way. It is a list of terms defined by the following predicate (see
tag_attrib/1
definition in
canonic_html_term/1
):
canonic_xml_item(Term) :- canonic_html_item(Term). canonic_xml_item(xmldecl(Atts)) :- list(Atts,tag_attrib). canonic_xml_item(env(Tag,Atts,Terms)) :- atm(Tag), list(Atts,tag_attrib), canonic_xml_term(Terms). canonic_xml_item(elem(Tag,Atts)) :- atm(Tag), list(Atts,tag_attrib).
In addition to the structures defined by
canonic_html_term/1
(the ($)/2
structure appears only in malformed XML code), the following structures can be used:
elem(arc,[weigh="3",begin="n1",end="n2"])is output to (or parsed from):
<arc weigh="3" begin="n1" end="n2"/>
<?xml
atts?>
)
Usage: canonic_xml_term(XMLTerm)
XMLTerm
is a term representing XML code in canonical form.
A term which represents HTML or XML code in a structured way. In addition to the structures defined by
canonic_html_term/1
or
canonic_xml_term/1
, the following structures can be used:
pre
). Its use is otherwise discouraged.
<html>
).
</html>
).
--
<hr>
).
<br>
).
<p>
).
img$[src=
address]
).
a([href=
address],
text)
).
a([name=
name],
text)
).
h
n(
text)
).
<ul>
environment).
<ol>
environment).
','/2
operators). The last element of the sequence is the definition, the other (if any) are the defined terms (translates to a <dl>
environment).
icon_address/2
provides a colored bullet.
<pre>
environment).
<,>,&,"
and space) are translated into its quoted HTML equivalent.
_
.
checkbox
with name name, state is on
if the checkbox is initially checked.
radio
with name name (several radio buttons which are interlocked must share their name), value is the the value returned by the button, if selected=value the button is initially checked.
text
, hidden
, submit
, reset
, ldots
<select>
environment).
$
to indicate that they are selected (translates to a <select>
environment).
Content-type: text/html
).
address('clip@clip.dia.fi.upm.es')is translated into the HTML source
<address>clip@clip.dia.fi.upm.es</address>
a([href='http://www.clip.dia.fi.upm.es/'],"Clip home")represents the HTML source
<a href="http://www.clip.dia.fi.upm.es/">Clip home</a>
Usage: html_term(HTMLTerm)
HTMLTerm
is a term representing HTML code.
Usage: form_dict(Dict)
Dict
is a dictionary of values of the attributes of a form. It is a list of form_assignment
Usage: form_assignment(Eq)
Eq
is an assignment of value of an attribute of a form. It is defined by:
form_assignment(A=V) :- atm(A), form_value(V).
form_value(A) :- atm(A). form_value(N) :- num(N). form_value(L) :- list(L,string).
Usage: form_value(V)
V
is a value of an attribute of a form.
Usage: value_dict(Dict)
Dict
is a dictionary of values. It is a list of pairs atom=constant.
A term specifying an Internet Uniform Resource Locator. Currently only HTTP URLs are supported. Example: http('www.clip.dia.fi.upm.es',80,"/Software/Ciao/")
. Defined as
url_term(http(Host,Port,Document)) :- atm(Host), int(Port), string(Document).
Usage: url_term(URL)
URL
specifies a URL.
A parameter of an HTTP request:
http_date/1
.
"PiLLoW/1.1"
(or whatever version of PiLLoW is used) is appended.
from('user@machine')
).
Usage: http_request_param(Request)
Request
is a parameter of an HTTP request.
A parameter of an HTTP response:
head
parameter of the HTTP request is used, an empty list is get here.
http_date/1
.
content_type(text,html,[])
).
http_date/1
.
http_date/1
.
Usage: http_response_param(Response)
Response
is a parameter of an HTTP response.
http_date(Date)
Date
is a term defined as
http_date(date(WeekDay,Day,Month,Year,Time)) :- weekday(WeekDay), int(Day), month(Month), int(Year), hms_time(Time).
.
Usage: http_date(Date)
Date
is a term denoting a date.
Usage: weekday(WeekDay)
WeekDay
is a term denoting a weekday.
Usage: month(Month)
Month
is a term denoting a month.
Usage: hms_time(Time)
Time
is an atom of the form hh:mm:ss
Go to the first, previous, next, last section, table of contents.