Permalink
Browse files

Merge branch 'uw/xmerl-expand-simple/OTP-9034' into dev

* uw/xmerl-expand-simple/OTP-9034:
  Track parents when expanding #xmlElement records
  • Loading branch information...
2 parents 14c9ff2 + 4e28e50 commit 62dad961329a603110ce0e1d3f62554cc5228152 @lthor lthor committed Jan 26, 2011
Showing with 4 additions and 3 deletions.
  1. +4 −3 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,

0 comments on commit 62dad96

Please sign in to comment.