且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

嵌套的xml在vb.net中读写

更新时间:2023-11-24 16:25:58

看起来无效 XML < 1> < 2> 标签未关闭(相同的标签包含无效名称)。

您可以自动加载有效使用 DataSet.ReadXml XML 文件到数据集中/ a> [ ^ ]方法。

HI ALL,
need to read nested xml and store in datatable and write from datatable xml file in vb.net. file format is below

<contacts>
    <1>
    <firstname> FN </firstname>
    <lastname> LN </lastname>
    <address>
   <add1>A1</add1>
   <add2>A2</add2>
   <add3>A3</add3>
    </address>
    <city>NY</city>
    <country>USA</country>

    <2>
    <firstname> FN1 </firstname>
    <lastname> LN1 </lastname>
    <address>
   <add1>A11</add1>
   <add2>A21</add2>
   <add3>A31</add3>
    </address>
    <city>NY</city>
    <country>USA</country>

</contacts>


request immediate support. thanks

That does not look valid XML: <1> and <2> tags are not closed (the same tags have invalid names).
You may automatically load a valid XML file into a dataset using the DataSet.ReadXml[^] method.