2
什麼是採取與任意文本格式的文檔的最好辦法,說:功能XML建設階
Hello world
1.1.1 (John Doe)
Paragraph one here... pargraph one continued here
paragraph two here
並將其轉換成一個看起來像這樣的XML文檔:
<note id="1.1.1" author_first = "John" author_last = "Doe">
<paragraph>Paragraph one here... paragraph one continued here</paragraph>
<paragraph>paragraph two here</paragraph>
</note>
我能想到的唯一方法是使用XMLBuilder
類型類的標準命令方式是說Scanner
。但是,這看起來不像習慣斯卡拉。
謝謝!
請注意,如果您還沒有分析的數據,有多種方法可以做到其中沒有涉及XML。 :) – 2011-03-15 17:25:51