aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Thorsen <[email protected]>2011-01-26 14:02:08 +0100
committerLars Thorsen <[email protected]>2011-01-26 14:02:08 +0100
commit62dad961329a603110ce0e1d3f62554cc5228152 (patch)
treec9627305414d6ccc04eaf3485ec84543ab55bef4
parent14c9ff21544da8b5e195601ea21f9c954ee847da (diff)
parent4e28e50fbfbccba4d35197e21337655107ff0247 (diff)
downloadotp-62dad961329a603110ce0e1d3f62554cc5228152.tar.gz
otp-62dad961329a603110ce0e1d3f62554cc5228152.tar.bz2
otp-62dad961329a603110ce0e1d3f62554cc5228152.zip
Merge branch 'uw/xmerl-expand-simple/OTP-9034' into dev
* uw/xmerl-expand-simple/OTP-9034: Track parents when expanding #xmlElement records
-rw-r--r--lib/xmerl/src/xmerl_lib.erl7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/xmerl/src/xmerl_lib.erl b/lib/xmerl/src/xmerl_lib.erl
index 7b76a76a33..1b3a7e57f0 100644
--- a/lib/xmerl/src/xmerl_lib.erl
+++ b/lib/xmerl/src/xmerl_lib.erl
@@ -148,9 +148,10 @@ expand_element(Element) ->
expand_element(Element, Pos, Parents) ->
expand_element(Element, Pos, Parents, false).
-expand_element(E = #xmlElement{}, Pos, Parents, Norm) ->
- Content = expand_content(E#xmlElement.content, 1, Parents, Norm),
- Attrs = expand_attributes(E#xmlElement.attributes, 1, []),
+expand_element(E = #xmlElement{name = N}, Pos, Parents, Norm) ->
+ NewParents = [{N,Pos}|Parents],
+ Content = expand_content(E#xmlElement.content, 1, NewParents, Norm),
+ Attrs = expand_attributes(E#xmlElement.attributes, 1, NewParents),
E#xmlElement{pos = Pos,
parents = Parents,
attributes = Attrs,