Link to home
Start Free TrialLog in
Avatar of rapi71
rapi71

asked on

VB.net Error

I have a .net service version 1.14 Recently I cahnged to version 2.0
 There I'm agetting error as :
<UPC xml:space="preserve"> </UPC> Is there any way to take off xml:space="preserve"
 I want <UPC></UPC>
 On my Code  I'm using a  dataset


Dim mywriter As System.Xml.XmlTextWriter

            mywriter = New System.Xml.XmlTextWriter(file1, System.Text.Encoding.UTF8)

            With mywriter
                .Indentation = 4
                .IndentChar = " "
                .Formatting = .Indentation

                .WriteStartDocument()
                .Formatting = Formatting.Indented
                .WriteStartElement("CMRequest ")
                .WriteAttributeString("xmlns", "http://coursetracks.fheg.follett.com/CMRequest.xsd")
                .WriteStartElement("Header")
                .WriteAttributeString("message-class", "EDIIN")
                .WriteAttributeString("message-id", lawson_id12)
                .WriteAttributeString("message-date", sysdate)
                .WriteEndElement()
                .WriteStartElement("Data")
                .WriteStartElement("LawsonInvoices")
                .WriteAttributeString("xmlns ", "http://coursetracks.fheg.follett.com/LawsonInvoice.xsd")

                LawsonInvoice1.WriteXml(mywriter, XmlWriteMode.IgnoreSchema)

                .WriteFullEndElement()
                .WriteEndDocument()
            End With

            mywriter.Flush()
            mywriter.Close()
Avatar of YZlat
YZlat
Flag of United States of America image

Avatar of rapi71
rapi71

ASKER

I want remove the sapce  in this  node
<UPC xml:space="preserve"> </UPC>
 I want to make as <UPC> </UPC>
you'll need something like that

xnode.Attributes.Remove(xnode)
ASKER CERTIFIED SOLUTION
Avatar of YZlat
YZlat
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial