<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<_XPXML>
<_FTrans Acc="1/0/01/02" Det1="03/0654" Det2="16/0002" Deb="10535129" Cre="0" Desc="10791" RefN="0" UnitAmount="1623.4" Unit="2"/>
<_FTrans Acc="4/0/00/01" Det1="09/1571" Det2="03/0654" Deb="0" Cre="279040" Desc="10791 1741 17005" ODesc="40702050298" RefN="545000" UnitAmount="51.2" Unit="2"/>
<_FTrans Acc="4/0/00/01" Det1="09/1571" Det2="03/0654" Deb="0" Cre="294300" Desc="10791 1741 17012" ODesc="40704110298" RefN="545000" UnitAmount="54" Unit="2"/>
<_FTrans Acc="4/0/00/01" Det1="09/1571" Det2="03/0654" Deb="0" Cre="285035" Desc="10791 1741 17032" ODesc="40700310198" RefN="545000" UnitAmount="52.3" Unit="2"/>
<_FTrans Acc="4/0/00/01" Det1="09/1571" Det2="03/0654" Deb="0" Cre="285035" Desc="10791 1741 17032" ODesc="40701020298" RefN="545000" UnitAmount="52.3" Unit="2"/>
<_FTrans Acc="4/0/00/01" Det1="09/1571" Det2="03/0654" Deb="0" Cre="279040" Desc="10791 1741 17034" ODesc="40708050298" RefN="545000" UnitAmount="51.2" Unit="2"/>
<_FTrans Acc="4/0/00/01" Det1="09/1571" Det2="03/0654" Deb="0" Cre="267050" Desc="10791 1741 17037" ODesc="40703310198" RefN="545000" UnitAmount="49" Unit="2"/>
<_FTrans Acc="4/0/00/01" Det1="09/1571" Det2="03/0654" Deb="0" Cre="288850" Desc="10791 1741 17042" ODesc="40706030298" RefN="545000" UnitAmount="53" Unit="2"/>
<_FTrans Acc="4/0/00/01" Det1="09/1571" Det2="03/0654" Deb="0" Cre="252335" Desc="10791 1741 54010" ODesc="40707110298" RefN="545000" UnitAmount="46.3" Unit="2"/>
<_FTrans Acc="4/0/00/01" Det1="09/1571" Det2="03/0654" Deb="0" Cre="333792" Desc="10791 7146 17005" ODesc="40679280198" RefN="684000" UnitAmount="48.8" Unit="2"/>
<_FTrans Acc="4/0/00/01" Det1="09/1571" Det2="03/0654" Deb="0" Cre="352260" Desc="10791 7146 17012" ODesc="40681020298" RefN="684000" UnitAmount="51.5" Unit="2"/>
<_FTrans Acc="4/0/00/01" Det1="09/1571" Det2="03/0654" Deb="0" Cre="329688" Desc="10791 7146 17019" ODesc="40675050198" RefN="684000" UnitAmount="48.2" Unit="2"/>
<_FTrans Acc="4/0/00/01" Det1="09/1571" Det2="03/0654" Deb="0" Cre="333792" Desc="10791 7146 17021" ODesc="40676140198" RefN="684000" UnitAmount="48.8" Unit="2"/>
</_XPXML>
Я использую следующую функцию, чтобы добавить строку в существующий XML-файл, но новая строка отличается от того, что я хочу. Как я могу это исправить.
новая строка:
<_FTrans Acc="4/0/00/01" Det1="09/1571" Det2="03/0654" Deb="0" Cre="326268" Desc="10791 7146 17023" ODesc="40677270198" RefN="684000" UnitAmount="47.7" Unit="2"/>
функция:
Function fnUpdateXMLByTags()
Dim mainWorkBook As Workbook
Set mainWorkBook = ActiveWorkbook
Set oXMLFile = CreateObject("Microsoft.XMLDOM")
XMLFileName = "C:\Users\SHIVAMAIN\Documents\trash\doc\TEST.XML"
oXMLFile.Load (XMLFileName)
Set ParentNode = oXMLFile.SelectSingleNode("/_XPXML")
Set childNode = oXMLFile.CreateElement("NewNode")
childNode.Text = "_FTrans Unit=""2"" UnitAmount=""47.7"" RefN=""684000"" Desc=""10791 7146 17023"" Cre=""326268"" Deb=""0"" Det2=""03/0654"" Det1=""09/1571"" Acc=""4/0/00/01"" ODesc=""40677270198""/"
ParentNode.AppendChild childNode
oXMLFile.Save (XMLFileName)
EndFunction