Hi all,
Do you have any documentation or examples about how to use the XML capabilities in Ciao? (It doesn't matter if examples are not commented or documentation is in beta stage, I'm just looking for something to start)
Thanks in advance.
______________________________________________________________________________
_/ _/ _/_| Jordi Sabater Mir / _/ _/ _| IIIA - Institut d'Investigacio en Intel.ligencia Artificial _/ _/___| CSIC - Spanish Scientific Research Council _/ _/____| Campus Universitat Autonoma de Barcelona / _/ _| 08193 Bellaterra, Catalonia, Spain Ph.: +34 3 5809570 Fax.: +34 3 5809661 jsabater(a)iiia.csic.es http://www.iiia.csic.es ______________________________________________________________________________
We are finalizing the PiLLoW manual, shortly will be released along with a new version of Ciao.
//)
Just to advance you the documentation, I send the assertions (which will provide the documentation) for the predicate related to XML parsing (in $/library/pillow/html.pl):
:- comment(xml2terms(String,Terms), "@var{String} is a character list containing XML code and @var{Terms} is its prolog structured representation.").
:- true pred xml2terms(-string,+xmlterm) # "Translates a XML-term into the XML code it represents.". :- true pred xml2terms(+string,?xmlterm) # "Translates XML code into a structured XML-term.".
:- true prop xmlterm(T) + regtype # "@var{T} is a structured representation of XML code.".
Remember that, since PiLLoW is a package, it has to be loaded with :- use_package(pillow). An example of shell iteraction would be:
?- use_package(pillow). {Including /home/clip/Systems/ciao/library/pillow/pillow.pl {Including /home/clip/Systems/ciao/library/pillow/ops.pl } }
yes ?- set_prolog_flag(write_strings,on).
yes ?- xml2terms("<b r='1'>a</b><c p=3/>",T).
T = [env(b,[r="1"],["a"]),elem(c,[p="3"])] ? ,
1 ?- xml2terms(S,T).
S = "<b r=""1"">a</b><c p=""3""/>", T = [env(b,[r="1"],["a"]),elem(c,[p="3"])] ?
yes
//)