XMERL - path to DTD directory

Michael McDaniel erlang@REDACTED
Wed Apr 26 20:17:35 CEST 2006


 I give explicit path to dtd file ...


 {XMLn, _} = xmerl_scan:string( Xml, [{space, normalize} ,
	      {doctype_DTD, "/path/to/some/file.dtd"},
	      {validation, true}]) ,


 which does not really help if you have no information as to *which*
 dtd file should be used, though maybe you can consolidate some dtd
 files which cover various Xml input for different stages of operation.

 I wind up having something like

-record( dtd, { 
               rcv       = "/path/to/include/rcv.dtd" ,
               xmit      = "/path/to/include/xmit.dtd" ,
               query     = "/path/to/include/query.dtd" ,
               qRequest  = "/path/to/include/qRequest.dtd" ,
               qResponse = "/path/to/include/qResponse.dtd" 
}).


 and then use the appropriate field depending on what state the
 application is in

 {XMLn, _} = xmerl_scan:string( Xml, [{space, normalize} ,
	      {doctype_DTD, ConfRec#dtd.query},
	      {validation, true}]) ,



Following link was very helpful to me when I created the application:
http://www.erlang.org/ml-archive/erlang-questions/200501/msg00192.html


 ~Michael


On Wed, Apr 26, 2006 at 04:28:56PM +0200, karol skocik wrote:
> Hi,
>  I hope that I did not overlooked something obvious in manual, but it
> there any way to tell XMERL where to search for DTD files needed for
> parsing? In the module xmerl_scan, the only option involving
> directories is {xmlbase, Dir} which does not help.
> 
> Thank you,
>  Karol



More information about the erlang-questions mailing list