如何用此字符串编写.xml文件?用字符串编写XML
字符串:
string string1 = textbox1.text;
string string2 = textbox2.text;
string string3 = textbox3.text;
string string4 = textbox4.text;
xml文件的结果:
<?xml version="1.0" encoding="utf-8" ?>
<books>
<book Title="Pure JavaScript" Price=string1/>
<book Title="Effective C++" Price=string2/>
<book Title="Assembly Language: Step-By-Step" Price=string3/>
<book Title="Oracle PL/SQL Best Practices" Price=string4/>
</books>
您的代码示例中有8个不同的字符串,并且由于默认命名,我们不知道每个字符的含义。很难看出这些应该如何与您的XML相匹配。 – Oded
XML也是无效的,因为'Price'属性没有引用值。 – Oded