我有大约8000个需要转换为文本文件的xml文件。文本文件必须包含xml文件的标题,描述和关键字,而不包含标签,并且还要删除其他元素和属性。换句话说,我需要创建8000个文本文件,其中包含XML文件的标题,描述和关键字。我需要系统地编写这些代码。任何帮助将不胜感激。提前致谢。如何将Xml文件转换为文本文件2
嘿,大家都非常感谢你的回复。 这里是什么我的XML看起来像一个示例:
<?xml version="1.0"?>
<metadata>
<identifier>43productionsNightatthegraveyard</identifier>
<title>Night at the graveyard</title>
<collection>opensource_movies</collection>
<mediatype>movies</mediatype>
<resource>movies</resource>
<upload_application appid="ccPublisher" version="2.2.1"/>
<uploader>[email protected]</uploader>
<description>una noche en el cementerio (terror)</description>
<license>http://creativecommons.org/licenses/by-nc/3.0/</license>
<title>Night at the graveyard</title>
<format>Video</format>
<adder>[email protected]</adder>
<licenseurl>http://creativecommons.org/licenses/by-nc/3.0/</licenseurl>
<year>2007</year>
<keywords>Night,at,the,graveyard,43,productions</keywords>
<holder>43 productions</holder>
<publicdate>2007-04-11 19:52:28</publicdate>
</metadata>
,这将是输出:
乌纳晚报EN EL cementerio(恐怖)在墓地
夜
夜,在,墓地,43,制作
这需要保存为相同的名称,但文本格式。非常感谢,如果有更多的建议,将不胜感激。
不需要两个单独的问题。 http://stackoverflow.com/questions/2941264/how-to-convert-xml-files-to-text-files – 2010-05-31 05:31:21