Reversing breaking fix and using OuterXML as content to include any attributes as well as element contents.

This commit is contained in:
Sipke Schoorstra
2014-07-24 12:02:04 -07:00
parent 192e57c739
commit be37ee54dc

View File

@@ -77,29 +77,19 @@ namespace Orchard.AuditTrail.Providers.Content {
}
break;
case "add":
if (isAttributeChange) {
var attributeName = match.Substring(1);
var value = reader.ReadElementContentAsString();
readNext = false;
yield return new DiffNode {
Type = DiffType.Addition,
Context = BuildContextName(stack, attributeName),
Current = value
var nodeName = reader.GetAttribute("name");
var addedContent = default(string);
reader.Read();
if (reader.NodeType != XmlNodeType.EndElement) {
nodeName = reader.Name;
addedContent = reader.ReadOuterXml();
}
yield return
new DiffNode {
Type = DiffType.Addition,
Context = BuildContextName(stack, nodeName),
Current = addedContent
};
}
else {
var elementName = currentElement.Name.ToString();
var content = reader.ReadElementContentAsString();
readNext = false;
yield return
new DiffNode {
Type = DiffType.Addition,
Context = BuildContextName(stack, elementName),
Current = content
};
}
break;
}
}