Dear all,
I am using XmlTextWriter for writing the xml file. The code is as follow:
Dim test As XmlTextWriter = Nothing
Dim UTF8 As New UTF8Encoding
test = New XmlTextWriter("C:\abcd.xml", UTF8)
With test
.Formatting = Formatting.Indented
.Indentation = 4
.IndentChar = " "
.WriteStartDocument()
.WriteDocType("SOGenericInterchange", Nothing,
"SOGenericInterchange.dtd", Nothing)
.WriteStartElement("a")
.WriteElementString("abc", "")
.WriteEndElement()
.Close()
End With
The xml file output will be as follow:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE SOGenericInterchange SYSTEM "SOGenericInterchange.dtd">
<a>
<abc /> <---- a space appears behind abc
</a>
The problem is that a space appears behind abc. I do not need a space
behind abc. How can I solve the problem?
Please help.
Thanks a lot,
Ray