属性にアクセスできるコレクションがあるように、C#プロジェクトに読み込む必要がある次のxmlファイルがあります。私は遠くにはいないが、いくつかの試みを試みた。前に見たことがあるが、複製できないxmlを表すためにクラスを使用したいと思います。私はストリームリーダにファイルを読み込んで値を取り出すのは嫌です。以前のプロジェクトでは、クラスの[Serializable]属性を使用していたと思います。C#4.0を使用して必要なXmlファイルのクラス表現
希望すると便利ですか?もっと必要な場合は、C#4.0を使用しています。
おかげで、 ジェームズ
<MyProducts xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<MyProduct MyProductCode="MBB" MyProductCategory="Computer" MyProductMaxNumber = "4">
<MyProductLookups>
<MyProductLookup Lang="AAA">Test 1</MyProductLookup>
<MyProductLookup Lang="BBB">Test 2</MyProductLookup>
<MyProductLookup Lang="CCC">Test 3</MyProductLookup>
<MyProductLookup Lang="DDD">Test 4</MyProductLookup>
</MyProductLookups>
</MyProduct>
<MyProduct MyProductCode="LJJ" MyProductCategory="Laptop" MyProductMaxNumber = "4">
<MyProductLookups>
<MyProductLookup Lang="AAA">Test 5</MyProductLookup>
<MyProductLookup Lang="BBB">Test 6</MyProductLookup>
<MyProductLookup Lang="CCC">Test 7</MyProductLookup>
<MyProductLookup Lang="DDD">Test 8</MyProductLookup>
</MyProductLookups>
</MyProduct>
xmlをオブジェクトにシリアル化するためのC#コード(以前はツールを使用したとは思わない) –
はい - このツールはXMLファイルの構造を表すクラスのコードを生成するので、それらを書く必要がありません。 2番目のリンクを見てください。 – Matthias
私は問題は、それらを解析する方法、素晴らしいツールだと思う。 – ntziolis