Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Source file tyxml_xml.ml
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119(* TyXML
* http://www.ocsigen.org/tyxml
* Copyright (C) 2004 Thorsten Ohl <ohl@physik.uni-wuerzburg.de>
* Copyright (C) 2007 Gabriel Kerneis
* Copyright (C) 2010 Cecile Herbelin
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, with linking exception;
* either version 2.1 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1301, USA.
*)moduleM=structmoduleW=Xml_wrap.NoWraptype'awrap='atype'alist_wrap='alisttypeuri=stringleturi_of_strings=sletstring_of_uris=stypeseparator=Space|Comma(** Attributes *)typeaname=stringtypeacontent=|AFloatoffloat|AIntofint|AStrofstring|AStrLofseparator*stringlisttypeattrib=aname*acontenttypeevent_handler=stringtypemouse_event_handler=stringtypekeyboard_event_handler=stringtypetouch_event_handler=stringletacontent(_,a)=aletaname(name,_)=nameletfloat_attribnamevalue=name,AFloatvalueletint_attribnamevalue=name,AIntvalueletstring_attribnamevalue=name,AStrvalueletspace_sep_attribnamevalues=name,AStrL(Space,values)letcomma_sep_attribnamevalues=name,AStrL(Comma,values)letevent_handler_attribnamevalue=name,AStrvalueletmouse_event_handler_attribnamevalue=name,AStrvalueletkeyboard_event_handler_attribnamevalue=name,AStrvaluelettouch_event_handler_attribnamevalue=name,AStrvalueleturi_attribnamevalue=name,AStrvalueleturis_attribnamevalues=name,AStrL(Space,values)(** Element *)typeename=stringtypeecontent=|Empty|Commentofstring|EncodedPCDATAofstring|PCDATAofstring|Entityofstring|Leafofename*attriblist|Nodeofename*attriblist*econtentlisttypeelt=econtentletcontentelt=eltletempty()=Emptyletcommentc=Commentcletpcdatad=PCDATAdletencodedpcdatad=EncodedPCDATAdletentitye=Entitye(* For security reasons, we do not allow "]]>" inside CDATA
(as this string is to be considered as the end of the cdata)
*)letre_end_cdata=Re.(compile@@str"]]>")letencoded_cdatas1s2s=encodedpcdata(Printf.sprintf"\n%s\n%s\n%s\n"s1(Re.replace_string~all:truere_end_cdata~by:""s)s2)letcdata=encoded_cdata"<![CDATA[""]]>"letcdata_script=encoded_cdata"//<![CDATA[""//]]>"letcdata_style=encoded_cdata"/* <![CDATA[ */""/* ]]> */"letleaf?(a=[])name=Leaf(name,a)letnode?(a=[])namechildren=Node(name,a,children)endincludeMincludeXml_print.Make_simple(M)(structletemptytags=[]end)[@@ocaml.warning"-3"]includeXml_iter.Make(M)includeXml_print.Make_fmt(M)(structletemptytags=[]end)includeXml_stream.Import(M)letprintfmtx=print_list~output:(Format.pp_print_stringfmt)[x]