Custom xmlWriter to skip a certain element?
问题 I am implementing a custom xmlwriter and I want to omit any elements with a particular name, like <ABC> . How do I actually do that? I get a sense that I might need to overwrite the WriteStartElement method like this: public override void WriteStartElement(string prefix, string localName, string ns) { if (localName.Equals("ABC")) { return; } base.WriteStartElement(prefix, localName, ns); } Do I also need to overwrite WriteEndElement method? How do I tell WriteEndElement method to skip writing