Parse Excel to xml using vba using Excel column data as XML attributes

خرید بک لینک

I have an Excel table with data in column1 and id's to this data in column2.

column1;column2

dataCol1Row1;dataCol2Row1

dataCol1Row2;dataCol2Row2

Using any of the VB examples given in Parse Excel to xml using VBA, my XML output file looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<root>
    <node type="test" id="2">
        <data>r1c1</data>
        <id>r1c2</id>
    </node>
    <node type="test" id="3">
        <data>r2c1</data>
        <id>r2c2</id>
    </node>
</root>

How would I change any of the VB examples to output my second column as attribute id to the first column data?

<?xml version="1.0" encoding="UTF-8"?>
<root>
    <node>
        <data id="r1c2">r1c1</data>
    </node>
    <node>
        <data id="r2c2">r2c1</data>
    </node>
</root>

Also, how can I make the output XML have encoding UTF-8 without BOM marker?

/Thanks

Recent Questions...

ما را در سایت Recent Questions دنبال می‌کنید

برچسب: نویسنده: استخدام کار بازدید: 362 تاريخ: سه شنبه 5 مرداد 1395 ساعت: 8:01

صفحه بندی