Wrong XML Format

  • Thread starter Thread starter Tamir Khason
  • Start date Start date
T

Tamir Khason

After serialization XMLNode recieved consist of \" signs instead of ". So it
can not be parsed and processed. How to get rid of it?
 
please provide an example of what was produced, what was expected, and the
code that produced it.
--- Nick
 
Hi Tamir,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that the quotes were serialized to \" in
your application. If there is any misunderstanding, please feel free to let
me know.

As far as I know, quote will not be coverted to \" in the serialization.
Could you try to open the xml file after serialization in Notepad and check
it again? If the problem still persists, could you provide us an example as
Nick mentioned, so that we can deliver our assistance more quickly?

If anything is unclear, please feel free to reply to the post.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 
I think that I know what is a problem, however following the method wich
called it

SomeClass.Serializer ser = new SomeClass.Serializer();

System.Xml.XmlDocument doc = new System.Xml.XmlDocument();


doc.AppendChild(doc.ImportNode(SomeOtherClass.GetObjectsData(),true)); //
return serialized XML Node

return ser.DeSerialize(doc); //make deserialization

-------------------------

Strange thing,

doc.InnerXML == doc.OuterXml.

The XML was previously serialized and saved:

Here is the beginning of this XML

doc.OuterXml "<TESTData xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns=\"Some
Processes\"><ProcessCollection Name=\"Process
1\"> said:
2</p3><p4>1</p4></SIG><Position><PinX>0</PinX><PinY>0</PinY></Position></Na
mes>" string

etc...etc As you can see all " are covered by \

What to do. Desiarilization failed on

There is an error in XML document (1, 2). --->

System.InvalidOperationException:

<TESTData xmlns='TestNameSpace'> was not expected.

Why it need it???





--
Tamir Khason
You want dot.NET? Just ask:
"Please, www.dotnet.us "
 
Hi Tamir,

Could you let me know, where did you check the content of doc.OuterXml? Did
you check it in the watch window? If so, the " were not converted at all,
the \ was added only for display. If you put the OuterXml into a TextBox
for display, you will not see the \.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 
You are right. The REAL problem described at my post with title : "
De/Serialization problem

" at 05-Jul-04

Please assist with it, if you can
 
Back
Top