aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorLars Thorsen <[email protected]>2011-12-13 13:36:25 +0100
committerLars Thorsen <[email protected]>2011-12-13 13:36:25 +0100
commit97620b3aaeeb3a00444bb7770aa0d74afea5bb4e (patch)
tree3ddc6a2870ad766da8b838bb83b0e0a74052f2d5 /lib
parentb92ea63417bc6933393a3c285faf393b3d287ac2 (diff)
downloadotp-97620b3aaeeb3a00444bb7770aa0d74afea5bb4e.tar.gz
otp-97620b3aaeeb3a00444bb7770aa0d74afea5bb4e.tar.bz2
otp-97620b3aaeeb3a00444bb7770aa0d74afea5bb4e.zip
[xmerl] Fix bug in namespace handling for attributes
The uniqueness check of attributes failed when the namespace_conformant flag was set to true.
Diffstat (limited to 'lib')
-rw-r--r--lib/xmerl/doc/src/notes.xml7
-rw-r--r--lib/xmerl/src/xmerl_scan.erl11
2 files changed, 14 insertions, 4 deletions
diff --git a/lib/xmerl/doc/src/notes.xml b/lib/xmerl/doc/src/notes.xml
index 8fa352d951..8734bd8771 100644
--- a/lib/xmerl/doc/src/notes.xml
+++ b/lib/xmerl/doc/src/notes.xml
@@ -48,6 +48,13 @@
<p>
Own Id: OTP-9753</p>
</item>
+ <item>
+ <p>
+ Fix bug in namespace handling for attributes when the
+ <c>namespace_conformant</c> flag is set to true. </p>
+ <p>
+ Own Id: OTP-9821</p>
+ </item>
</list>
</section>
diff --git a/lib/xmerl/src/xmerl_scan.erl b/lib/xmerl/src/xmerl_scan.erl
index ec7ea534d6..48951b6723 100644
--- a/lib/xmerl/src/xmerl_scan.erl
+++ b/lib/xmerl/src/xmerl_scan.erl
@@ -2108,21 +2108,24 @@ scan_element(">" ++ T, S0 = #xmerl_scanner{event_fun = Event,
NSI, Namespace, SpaceDefault) ->
?bump_col(1),
Attrs = lists:reverse(Attrs0),
- wfc_unique_att_spec(Attrs,S),
- XMLSpace = case lists:keysearch('xml:space', #xmlAttribute.name, Attrs) of
+ E0=processed_whole_element(S,Pos,Name,Attrs,Lang,Parents,NSI,Namespace),
+
+ #xmlElement{attributes = Attrs1} = E0,
+ wfc_unique_att_spec(Attrs1,S),
+ XMLSpace = case lists:keysearch('xml:space', #xmlAttribute.name, Attrs1) of
false -> SpaceDefault;
{value, #xmlAttribute{value="default"}} -> SpaceOption;
{value, #xmlAttribute{value="preserve"}} -> preserve;
_ -> SpaceDefault
end,
- E0=processed_whole_element(S,Pos,Name,Attrs,Lang,Parents,NSI,Namespace),
+ E0=processed_whole_element(S,Pos,Name,Attrs1,Lang,Parents,NSI,Namespace),
S1 = #xmerl_scanner{} = Event(#xmerl_event{event = started,
line = StartL,
col = StartC,
data = E0}, S),
- {Content, T1, S2} = scan_content(T, S1, Name, Attrs, XMLSpace,
+ {Content, T1, S2} = scan_content(T, S1, Name, Attrs1, XMLSpace,
E0#xmlElement.language,
[{Name, Pos}|Parents], Namespace),