diff options
author | Lars Thorsen <[email protected]> | 2017-02-16 10:28:17 +0100 |
---|---|---|
committer | Lars Thorsen <[email protected]> | 2017-02-16 10:28:17 +0100 |
commit | 381f97b30092624b238a68909855692929d6f8bf (patch) | |
tree | 70d7312de7d055f2b3381d70c2e3067f0008439c /lib/xmerl/src | |
parent | aa1a098b46d0a4d8dd122efcc78a7a1a3f6c6e4e (diff) | |
parent | 5cb6de0c1db376236f7467af04324faa408af312 (diff) | |
download | otp-381f97b30092624b238a68909855692929d6f8bf.tar.gz otp-381f97b30092624b238a68909855692929d6f8bf.tar.bz2 otp-381f97b30092624b238a68909855692929d6f8bf.zip |
Merge branch 'lars/xmerl/standard-namespace-problem/OTP-14139' into maint
* lars/xmerl/standard-namespace-problem/OTP-14139:
[xmerl] Correct handling of implicit XML namespace
Diffstat (limited to 'lib/xmerl/src')
-rw-r--r-- | lib/xmerl/src/xmerl_scan.erl | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/xmerl/src/xmerl_scan.erl b/lib/xmerl/src/xmerl_scan.erl index 9f6b27113e..95dc82e5c9 100644 --- a/lib/xmerl/src/xmerl_scan.erl +++ b/lib/xmerl/src/xmerl_scan.erl @@ -2309,7 +2309,9 @@ expanded_name(Name, [], #xmlNamespace{default = URI}, S) -> expanded_name(Name, N = {"xmlns", Local}, #xmlNamespace{nodes = Ns}, S) -> {_, Value} = lists:keyfind(Local, 1, Ns), case Name of - 'xmlns:xml' when Value =/= 'http://www.w3.org/XML/1998/namespace' -> + 'xmlns:xml' when Value =:= 'http://www.w3.org/XML/1998/namespace' -> + N; + 'xmlns:xml' when Value =/= 'http://www.w3.org/XML/1998/namespace' -> ?fatal({xml_prefix_cannot_be_redeclared, Value}, S); 'xmlns:xmlns' -> ?fatal({xmlns_prefix_cannot_be_declared, Value}, S); @@ -2323,6 +2325,8 @@ expanded_name(Name, N = {"xmlns", Local}, #xmlNamespace{nodes = Ns}, S) -> N end end; +expanded_name(_Name, {"xml", Local}, _NS, _S) -> + {'http://www.w3.org/XML/1998/namespace', list_to_atom(Local)}; expanded_name(_Name, {Prefix, Local}, #xmlNamespace{nodes = Ns}, S) -> case lists:keysearch(Prefix, 1, Ns) of {value, {_, URI}} -> @@ -2333,9 +2337,6 @@ expanded_name(_Name, {Prefix, Local}, #xmlNamespace{nodes = Ns}, S) -> ?fatal({namespace_prefix_not_declared, Prefix}, S) end. - - - keyreplaceadd(K, Pos, [H|T], Obj) when K == element(Pos, H) -> [Obj|T]; keyreplaceadd(K, Pos, [H|T], Obj) -> |