diff options
author | Lars Thorsen <[email protected]> | 2011-01-26 14:02:08 +0100 |
---|---|---|
committer | Lars Thorsen <[email protected]> | 2011-01-26 14:02:08 +0100 |
commit | 62dad961329a603110ce0e1d3f62554cc5228152 (patch) | |
tree | c9627305414d6ccc04eaf3485ec84543ab55bef4 | |
parent | 14c9ff21544da8b5e195601ea21f9c954ee847da (diff) | |
parent | 4e28e50fbfbccba4d35197e21337655107ff0247 (diff) | |
download | otp-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.erl | 7 |
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, |