XML anti-serialization Namespace is not uniform

xiaoxiao2021-03-06  14

When the XML is contrast, if Namespace is not uniform, it will cause an error.

For example, it is necessary to reverse serialization of this XML:

10 Just Test

Declare a class of Class first in the program:

Public Class Test Public A As Integer Public B AS Stringend Class

then:

DIM Serializer As New XMLSerializer (Gettype (ROOT)) T = CType (Serializer.Deserialize (s), root

Where T is the example of Test, and S is a STREAM of XML.

Normal anti-stroke should be this process, but it will get an error. Because Serializer doesn't know the XML Namespace, you need to specify the namespace, the method is:

_public class test public a as integer public b as stringend class

In this way, XML's Namespace is unified, and it can be configured normally.

转载请注明原文地址:https://www.9cbs.com/read-48454.html

New Post(0)