[erlang-patches] [PATCH] Teach xmerl_xpath to resolve context namespaces in more cases

Fredrik fredrik@REDACTED
Fri Sep 13 08:44:53 CEST 2013


On 09/12/2013 06:52 PM, Daniel White wrote:
> These patches teach attribute name tests and node prefix (wildcard)
> name tests to behave like element name tests.
>
> Assuming the following document has been scanned with
> `{namespace_conformant, true}`:
>
> <root xmlns:ns1="http://www.example.com/ns">
>    <child ns1:attr="example" />
> </root>
>
> The current behaviour is as such:
>
>> [#xmlElement{}] = xmerl_xpath:string("/root/ns1:child", Doc).
>> [#xmlAttribute{}] = xmerl_xpath:string("/root/ns1:child/@ns1:attr", Doc).
>> [#xmlElement{}] = xmerl_xpath:string("/root/t:child", Doc,  [{namespace, [{"t", "http://www.example.com/ns"}]}]).
>> [] = xmerl_xpath:string("/root/t:child/@t:attr", Doc,  [{namespace, [{"t", "http://www.example.com/ns"}]}]).
> The latter case here is surprising, and should return the attribute as
> it can be resolved by the provided namespace.
>
>
> git fetch git://github.com/danielwhite/otp.git
> xmerl-xpath-resolve-context-namespaces
>
> https://github.com/danielwhite/otp/compare/xmerl-xpath-resolve-context-namespaces
> https://github.com/danielwhite/otp/compare/xmerl-xpath-resolve-context-namespaces.patch
>
> Cheers,
>
> --
> Daniel White
> _______________________________________________
> erlang-patches mailing list
> erlang-patches@REDACTED
> http://erlang.org/mailman/listinfo/erlang-patches
Hello Daniel,
I've fetched your patch and assigned it to be reviewed by the 
responsible team.
Thanks,

-- 

BR Fredrik Gustafsson
Erlang OTP Team




More information about the erlang-patches mailing list