2015年3月20日金曜日

[Modding]xml解析:headlines

本稿ではMOD作成の前提として、xmlに書かれた情報を解析していきます。

今回は新聞に書かれる記事の内容を記述する、
headlinesテーブルを解析します。

※ネタバレ成分は特にありません。




サンプルデータ

データの参照元はheadlines.xmlです。
今回のサンプルデータはこちらになります。
(文章には適当に改行を追加してあります)
<table name="headlines">
    <column name="id">1</column>
    <column name="strHeadline">
Sowing the Seeds of Destruction
Agrasanto corporation successfully lobbied
the dismantling of Svalbard Seed Vault last Tuesday.
Arguing that the collection of seeds
represented a contamination risk for its own line
of genetically modified seeds,
aggressive marketing and lobbying pressured
the Norwegian government to dismantle the seed vault project.
Agrasanto seeds are used in over 73% of global agriculture,
and contamination of even a single strain of the Agrasanto seed
could devastate food production worldwide.
    </column>
</table>

columnの解析

設定されている項目はstrHeadlineのみです。
ここに文章を用意しておけば、新聞記事としてアイテムに反映されるようです。


デジタルデータと違って、こちらは"新聞紙"という本質を持っていますが、
アイテムとしての新聞紙は1種類で、
"特定の記事が書かれた新聞紙を持っている"という判定はおそらく不可能です。

内容に関しては興味深いものもあるので、現在翻訳記事の準備中ですが
今回はこういうテーブルがある、という点だけ覚えてもらえれば問題ありません。



0 件のコメント:

コメントを投稿