我想在這樣格式的XML:如何在C#中使用WriteStartDocument WriteStartElement WriteAttributeString格式化XML?
<?xml version="1.0" encoding="UTF-8"?>
<ftc:A xmlns="urn:oecd:ties:stfatypes:v1" xmlns:ftc="urn:oecd:ties:a:v1" xmlns:xsi="http://www.a.com/2001/XMLSchema-instance" version="1.1" xsi:schemaLocation="urn:oecd:ties:a:v1 aXML_v1.1.xsd">
<ftc:b>
<z issuedBy = "s">1</z>
<x>CO</x>
</ftc:b>
</ftc:A>
我忘記了屬性issuedBy, 我有麻煩寫的屬性白衣方法:
writer.WriteStartDocument();
writer.WriteStartElement();
writer.WriteAttributeString();
writer.WriteElementString();
我只需要在C#中的例子請:) :)
對於這個,使用'XDocument'(LINQ to XML)不是更容易嗎? – t3chb0t 2014-12-07 20:41:28