123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178(*********************************************************************************)(* Xtmpl *)(* *)(* Copyright (C) 2012-2021 Institut National de Recherche en Informatique *)(* et en Automatique. All rights reserved. *)(* *)(* This program is free software; you can redistribute it and/or modify *)(* it under the terms of the GNU Lesser General Public License version *)(* 3 as published by the Free Software Foundation. *)(* *)(* 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 Library 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., 59 Temple Place, Suite 330, Boston, MA *)(* 02111-1307 USA *)(* *)(* Contact: Maxence.Guesdon@inria.fr *)(* *)(* *)(*********************************************************************************)(** *)openRewritetypeelt_fun=?xid:treelist->?id:string->?xclass:treelist->?class_:string->?classes:stringlist->?xhref:treelist->?href:string->?xtitle:treelist->?title:string->?xtype:treelist->?type_:string->?xname:treelist->?name:string->?atts:attributes->treelist->treetypeelt_fun_=?prefix:string->string->elt_funletaddattsnamecdataxml=matchcdata,xmlwith|None,None->atts|Sometext,None->atts_one~atts("",name)[Rewrite.cdatatext]|None,Somexmls->atts_one~atts("",name)xmls|Sometext,Somexmls->atts_one~atts("",name)((Rewrite.cdatatext)::xmls)letelt:elt_fun_=fun?(prefix="")tag?xid?id?xclass?class_?classes?xhref?href?xtitle?title?xtype?type_?xname?name?(atts=atts_empty)subs->letatts=addatts"id"idxidinletatts=addatts"href"hrefxhrefinletatts=addatts"title"titlextitleinletatts=addatts"type"type_xtypeinletatts=addatts"name"namexnameinletatts=letclass_=matchclass_,classeswithNone,None->None|Some_,None->class_|None,Somel->Some(String.concat" "l)|Somes,Somel->Some(String.concat" "(s::l))inaddatts"class"class_xclassinRewrite.node(prefix,tag)~attssubslethtml=elt"html"lethead=elt"head"letmeta=elt"meta"lettitle=elt"title"letbase=elt"base"letlink=elt"link"letstyle=elt"style"letbody=elt"body"letarticle=elt"article"letsection=elt"section"letnav=elt"nav"letaside=elt"aside"leth1=elt"h1"leth2=elt"h2"leth3=elt"h3"leth4=elt"h4"leth5=elt"h5"leth6=elt"h6"letheader=elt"header"letfooter=elt"footer"letaddress=elt"address"letp=elt"p"lethr=elt"hr"[]letpre=elt"pre"letblockquote=elt"blockquote"letol=elt"ol"letul=elt"ul"letli=elt"li"letdl=elt"dl"letdt=elt"dt"letdd=elt"dd"letfigure=elt"figure"letfigcaption=elt"figcaption"letdiv=elt"div"letmain=elt"main"leta=elt"a"letem=elt"em"letstrong=elt"strong"letsmall=elt"small"lets=elt"s"letcite=elt"cite"letq=elt"q"letdfn=elt"dfn"letabbr=elt"abbr"letdata=elt"data"lettime=elt"time"letcode=elt"code"letvar=elt"var"letsamp=elt"samp"letkbd=elt"kbd"letsub=elt"sub"letsup=elt"sup"leti=elt"i"letb=elt"b"letu=elt"u"letmark=elt"mark"letruby=elt"ruby"letrb=elt"rb"letrt=elt"rt"letrtc=elt"rtc"letrp=elt"rp"letbdi=elt"bdi"letbdo=elt"bdo"letspan=elt"span"letbr=elt"br"[]letwbr=elt"wbr"[]letins=elt"ins"letdel=elt"del"letembed=elt"embed"letobject_=elt"object"letimg=elt"img"letaudio=elt"audio"letvideo=elt"video"letsource=elt"source"letscript=elt"script"lettable=elt"table"letcaption=elt"caption"letcolgroup=elt"colgroup"letcol=elt"col"lettbody=elt"tbody"letthead=elt"thead"lettfoot=elt"tfoot"lettr=elt"tr"lettd=elt"td"letth=elt"th"letform=elt"form"letlabel=elt"label"letinput=elt"input"letbutton=elt"button"letselect=elt"select"letdatalist=elt"datalist"letoptgroup=elt"optgroup"letoption=elt"option"lettextarea=elt"textarea"letkeygen=elt"keygen"letoutput=elt"output"letprogress=elt"progress"letmeter=elt"meter"letfieldset=elt"fieldset"letlegend=elt"legend"