<meta charset="utf-8"><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">It sounds like a big. xmerl_xsd for some reason will mess up your path.<div>I think this patch should solve your problem</div>
<div><br></div><div><div>index e56f147..3085bc7 100644</div><div>--- a/lib/xmerl/src/xmerl_xsd.erl</div><div>+++ b/lib/xmerl/src/xmerl_xsd.erl</div><div>@@ -288,9 +288,9 @@ process_schema(Schema) -></div><div> %% or a single error encountered during the processing.</div>
<div> process_schema(Schema,Options) when is_list(Options) -></div><div>     S = initiate_state(Options,Schema),</div><div>-    process_schema2(xmerl_scan:file(filename:join(S#xsd_state.xsd_base, Schema)),S,Schema);</div>
<div>+    process_schema2(xmerl_scan:file(filename:join(S#xsd_state.xsd_base, filename:basename(Schema))),S,Schema);</div><div> process_schema(Schema,State) when is_record(State,xsd_state) -></div><div>-    process_schema2(xmerl_scan:file(filename:join(State#xsd_state.xsd_base, Schema)),State,Schema).</div>
<div>+    process_schema2(xmerl_scan:file(filename:join(State#xsd_state.xsd_base, filename:basename(Schema))),State,Schema).</div><div> </div><div> process_schema2(Err={error,_},_,_) -></div><div>     Err;</div></div></span><br>
<div class="gmail_quote">On Wed, Jun 29, 2011 at 1:22 PM, Matti Oinas <span dir="ltr"><<a href="mailto:matti.oinas@gmail.com">matti.oinas@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi<br>
<br>
I'm trying to validate XML using XML schema but<br>
xmer_xsd:process_schema can't find schema in any other folder than the<br>
current pwd().<br>
<br>
>xmerl_xsd:process_schema("../include/user.xsd").<br>
{error,enoent}<br>
<br>
if I copy the user.xsd file into the folder returned by pwd() which<br>
happens to be src and modify the path to point to that copy the<br>
everything works just fine.<br>
<br>
>xmerl_xsd:process_schema("user.xsd").<br>
{ok,{xsd_state,"user.xsd",......<br>
<br>
xmerl_scan can find the file in both folders<br>
<br>
>xmerl_scan:file("../include/user.xsd").<br>
{{xmlElement,'xs:schema','xs:schema',....<br>
>xmerl_scan:file("user.xsd").<br>
{{xmlElement,'xs:schema','xs:schema',....<br>
<br>
It seems to be a bug or then I'm missing some point.<br>
<br>
I'm using erlang from arch(32 bit) linux repositories.<br>
<br>
Erlang R14B (erts-5.8.1) [source] [smp:2:2] [rq:2] [async-threads:0]<br>
[hipe] [kernel-poll:false]<br>
_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>Best Regards,<br>- Ahmed Omar<div><a href="http://nl.linkedin.com/in/adiaa" target="_blank">http://nl.linkedin.com/in/adiaa</a></div><div>Follow me on twitter</div><div><a href="http://twitter.com/#!/spawn_think" target="_blank">@spawn_think</a></div>
<br>