[Ocaml-pxp-users] How validate a XML string with a DTD

amata at tsc.uc3m.es amata at tsc.uc3m.es
Wed Apr 23 10:37:43 PDT 2003



Hi list;

I have a problem using PXP. I need to parse a XML document and 
validate it with a DTD. In order to do that, I use the function 
parse_document_entity. The xml document that I want validate is not a 
file, it is a string. I do that;

let d = Pxp_yacc.parse_document_entity default_config (from_string 
mystring) default_spec

The string to validate begins with the lines;

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE COMPETENCIA SYSTEM "./todo.dtd">

I need to validate the XML string with the DTD todo.dtd, but when I 
execute the program, it returns; 

ERROR: No input method available for this external entity: [dtd] = 
SYSTEM “./todo.dtd”

If I put the string into a file, and do that;

let d = Pxp_yacc.parse_document_entity default_config 
(from_file “myfile.xml”) default_spec

all works perfectly.

How can I validate the string with the DTD?

Thank you very much.







More information about the Ocaml-pxp-users mailing list