私の XML ファイルの形式は次のとおりです。
"<TestFile fileext="C:\TestFiles\TestFile2.txt">
</TestFile>"
ここで、ルート要素は「TestFile」です。私の仕事は、私が使用しているクエリであるこの形式の新しい XML を作成することです。
XDocument doc = new XDocument(
new XDeclaration("1.0", "utf-8", "yes"),
new XComment("This is a medtata file of the file " + args[0]),
new XElement("TestFile",path));
しかし、代わりに
"<TestFile fileext="C:\TestFiles\TestFile2.txt">
</TestFile>"
、出力は
"<TestFile>C:\TestFiles\TestFile2.txt</TestFile>"
どうすれば目的の出力を得ることができますか?