internal static void TraceEndElement(XmlReader reader, System.IO.TextWriter writer, bool indent) { if (null != writer) { if (indent) { writer.Write(Util.GetWhitespaceForTracing(2 + reader.Depth), 0, 2 + reader.Depth); } writer.Write("</{0}>", reader.Name); } }
internal static void TraceElement(XmlReader reader, System.IO.TextWriter writer) { Debug.Assert(XmlNodeType.Element == reader.NodeType, "not positioned on Element"); if (null != writer) { writer.Write(Util.GetWhitespaceForTracing(2 + reader.Depth), 0, 2 + reader.Depth); writer.Write("<{0}", reader.Name); if (reader.MoveToFirstAttribute()) { do { writer.Write(" {0}=\"{1}\"", reader.Name, reader.Value); }while (reader.MoveToNextAttribute()); reader.MoveToElement(); } writer.Write(reader.IsEmptyElement ? " />" : ">"); } }