David Cartwright wrote:
I have a VB.NET (VS2005, .NET 2.0) application producing an XML file which
is then used by a third-party product. It turns out the latter doesn't like
self-closing tags (i.e. it would rather see <CardNo></CardNothan <CardNo
/>).
Is there a simple way to tell the XMLDocument to use the "traditional" way
of showing an empty tag instead of always saving self-closing tags?
With XML <CardNo></CardNohas the same semantics as <CardNo/or
<CardNo /so you should rather blame that third party tool to not
conform to the XML specification.
As for trying to change your XML with .NET tools, how exactly do you
create the XML? If you use an XmlWriter then use WriteFullEndElement
<http://msdn2.microsoft.com/en-us/library/system.xml.xmlwriter.writefullendelement.aspx>
as that way you can ensure the <CardNo></CardNosyntax.
If you are using XmlDocument/XmlElement then there is a property IsEmpty
that you can set to false to get the form <CardNo></CardNo>.
--
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/