xml serialization class is not working with colon in element tag
Hello experts, I am using the xml serialization class to create a serialized xml file, within the xml i have tags that need to contain a colon. When the xml is created the colon is replaced with _x003A_
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
tentavarious
ASKER
Ok, when i go through and serialize the xml why does it put this tag on
<?xml version="1.0" encoding="utf-16"?>
instead of encoding it in utf-8 ?
tentavarious
ASKER
Hey guys i found the problem, this site provided me with the answer
The default encoding must be utf-16, so switching it to uft-8 before serializing seems to have fixed the issue.
tentavarious
ASKER
Ok, i still cant get this working, i am using the xsd.exe tool to create the xml serialization class based off the schema they are sending me. Can someone point me to a tutorial that better explains what i should be doing.
Unlimited question asking, solutions, articles and more.
tentavarious
ASKER
K, could someone explain what this code should be doing?
<System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.42"), _
System.SerializableAttribute(), _
System.Diagnostics.DebuggerStepThroughAttribute(), _
System.ComponentModel.DesignerCategoryAttribute("code"), _
System.Xml.Serialization.XmlTypeAttribute([Namespace]:="http://mycom.com/updatemachine"), _
System.Xml.Serialization.XmlRootAttribute("UpdateOrder", [Namespace]:="http://mycom.com/updatemachine", IsNullable:=False)> _
Partial Public Class UpdateOrderType
end Class
I left out all the variables, this code gets created when i run the xsd.exe tool on their provided shema? When i run this code the it creates this opening tag
<?xml version="1.0" encoding="utf-16"?>
<pre_x003A_SalesOrder xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<DataArea>
<Received>
<Status>SUCCESS</Status>
</Received>
<Order>
<Headinfo>
<Note>OrderDate: 3/8/2011</Note>
</Headinfo>
</Order>
</DataArea>
</pre_x003A_SalesOrder>
I cant post the xml code because it contains sensitive information but should i be looking for attribute tags like this?
System.Xml.Serialization.X
System.Xml.Serialization.X