Howdy:
I am currently writing a .Net handler to replace an ASP page. The ASP
module used a COM dll to format XML. This dll was pretty robust and
it auto-suppressed empty elements and attributes. A developer in my
group is porting the code into .Net, but I an still believe that there
is a way to do this in the native .Net classes. Is anyone familiar
with a way to do this using XmlTextWriter or another related class?
I found code that will allow me to load the resulting XML into an
XMLDocument and then I could use an XPath expression to remove the
empty elements. This is a potential solution, however the application
I am replacing didn't necessarily format syntatically correct XML. It
creates a bunch of elements with attributes and no value.
i.e. <element1 att1="att1"></element1>
So I need to account for that.
Please let me know what you think and thanks,
Tom