Я импортировал XML в Excel и хотел бы экспортировать XML из Excel, но исключаю некоторые сопоставленные узлы. Вот XML в настоящее время:
<?xml version="1.0" encoding="UTF-8" standalone="true"?>
-<ImportExportRecord xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Version>1.99</Version>
<Product>Test Software</Product>
-<Employees>
-<Employee>
<EmployeeID>76</EmployeeID>
<Name>John Smith</Name>
</Employee>
<Employees>
-<Job Roles>
-<Role>
-<Individual>
<Skillset>55</Skillset>
<Skillset2>854</Skillset2>
</Individual>
</Role>
</Job Roles>
-<Attributes>
-<Att1>
-<Related>
<DataInput>98545</DataInput>
<DataOutput>874445</DataOutput>
</Related>
</Att1>
</Attributes>
И я бы хотел экспортировать
<?xml version="1.0" encoding="UTF-8" standalone="true"?>
-<ImportExportRecord xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Version>1.99</Version>
<Product>Test Software</Product>
-<Employees>
-<Employee>
<EmployeeID>76</EmployeeID>
<Name>John Smith</Name>
</Employee>
<Employees>
-<Job Roles>
-<Role>
-<Individual>
<Skillset>55</Skillset>
</Individual>
</Role>
</Job Roles>
Код, который я сейчас использую для экспорта XML, выглядит так:
Sub ExportAsXMLData()
Dim objMapToExport As XmlMap
Set objMapToExport = ActiveWorkbook.XmlMaps("ALL")
If objMapToExport.IsExportable Then
ActiveWorkbook.SaveAsXMLData "Employee Data.xml", objMapToExport
Else
MsgBox "Cannot use " & objMapToExport.Name & _
"to export the contents of the worksheet to XML data."
End If
End Sub
Любая помощь будет принята с благодарностью.
Спасибо.