[erlang-questions] xmerl_xsd can't find schema

Lars Thorsen <>
Wed Jun 29 14:12:19 CEST 2011

Hi Matti,
I looked through the xmerl_xsd code and it is a bug in process_schema.
I must just check so the calls from xmerl_scan to xmerl_xsd when validating
an xml file works ok with the change.

A workaround while waiting for the fix is:

xmerl_xsd:process_schema(<xsd file without path>, [{xsdbase, <path to schema dir>}]).

There is just one thing that I wonder about, the only case that works for me when I use a path
to the schema is ../dir/file.xsd because ../dir/../dir/file.xsd is the same place.

Regards Lars

On 06/29/2011 01:22 PM, Matti Oinas wrote:
> Hi
> I'm trying to validate XML using XML schema but
> xmer_xsd:process_schema can't find schema in any other folder than the
> current pwd().
>> xmerl_xsd:process_schema("../include/user.xsd").
> {error,enoent}
> if I copy the user.xsd file into the folder returned by pwd() which
> happens to be src and modify the path to point to that copy the
> everything works just fine.
>> xmerl_xsd:process_schema("user.xsd").
> {ok,{xsd_state,"user.xsd",......
> xmerl_scan can find the file in both folders
>> xmerl_scan:file("../include/user.xsd").
> {{xmlElement,'xs:schema','xs:schema',....
>> xmerl_scan:file("user.xsd").
> {{xmlElement,'xs:schema','xs:schema',....
> It seems to be a bug or then I'm missing some point.
> I'm using erlang from arch(32 bit) linux repositories.
> Erlang R14B (erts-5.8.1) [source] [smp:2:2] [rq:2] [async-threads:0]
> [hipe] [kernel-poll:false]
> _______________________________________________
> erlang-questions mailing list
> http://erlang.org/mailman/listinfo/erlang-questions

More information about the erlang-questions mailing list