#540 OuterXml fails for an attribute node

v8.7.3
closed
Michael Kay
.NET API (34)
5
2012-10-08
2006-06-14
Michael Kay
No

In the .NET API, accessing the OuterXml property of an
attribute node causes a null pointer exception.

Source fix: in Model.cs, property OuterXml at line 671,
after the line:

NodeInfo node = ((NodeInfo)value);

insert the lines:

            if (node.getNodeKind() ==

JType.ATTRIBUTE) {
String val =
node.getStringValue().Replace("\"", """);
val = val.Replace("<", "<");
val = val.Replace("&", "&");
return node.getDisplayName() +
"=\"" + val + '"';
}

Michael Kay
http://www.saxonica.com/

Discussion