MARC.Everest.Xml Namespace
Classes within this namespace are used to facilitate the formatting of
data to/from XML
Classes
Remarks
The XmlStateWriter and XmlStateReader
classes are wrapper for the
XmlWriter and
XmlReader
classes respectively. These classes add the functionality of determining the path to the current
element and thus, are used by formatters to report errors.
Examples
The following example illustrates the use of the XmlStateWriter
Getting the current path
Stream s = Console.OpenStandardOutput();
XmlStateWriter writer = new XmlStateWriter(XmlWriter.Create(s));
writer.WriteStartElement("html");
writer.WriteStartElement("body");
string currentPath = writer.CurrentPath;
writer.WriteStartElement("p");
currentPath = writer.CurrentPath;
writer.WriteEndElement();
writer.WriteEndElement();
currentPath = writer.CurrentPath;
writer.WriteEndElement();