Module Ez_html.Dtd
The DTD Functions
val parse_file : string -> Xml_types.dtdParse the named file into a Dtd data structure. Raise
Xml_types.File_not_found if an error occurred while opening the file. RaiseDtd.Parse_errorif parsing failed.
val parse_in : Stdlib.in_channel -> Xml_types.dtdRead the content of the in_channel and parse it into a Dtd data structure. Raise
Dtd.Parse_errorif parsing failed.
val parse_string : string -> Xml_types.dtdParse the string containing a Dtd document into a Dtd data structure. Raise
Dtd.Parse_errorif parsing failed.
val check : Xml_types.dtd -> checkedCheck the Dtd data structure declaration and return a checked DTD. Raise
Dtd.Check_errorif the DTD checking failed.
val prove : checked -> string -> Xml_types.xml -> Xml_types.xmlProve an Xml document using a checked DTD and an entry point. The entry point is the first excepted tag of the Xml document, the returned Xml document has the same structure has the original one, excepted that non declared optional attributes have been set to their default value specified in the DTD. Raise
Dtd.Check_errorElementNotDeclaredif the entry point is not found, raiseDtd.Prove_errorif the Xml document failed to be proved with the DTD.
val to_string : Xml_types.dtd_item -> stringPrint a DTD element into a string. You can easily get a DTD document from a DTD data structure using for example
String.concat "\n" (List.map Dtd.to_string) my_dtd
The DTD Exceptions
type parse_error_msg=|InvalidDTDDecl|InvalidDTDElement|InvalidDTDAttribute|InvalidDTDTag|DTDItemExpectedtype check_error=type prove_error=type parse_error= parse_error_msg * Xml_types.error_pos
exceptionParse_error of parse_errorexceptionCheck_error of check_errorexceptionProve_error of prove_error
val parse_error : parse_error -> stringval check_error : check_error -> stringval prove_error : prove_error -> string