【发布时间】:2011-01-12 02:46:49
【问题描述】:
您好,在我有一个名为“slides”的文件夹并且其中有多个文本/html 文件的情况下,我需要帮助,例如: 幻灯片1.html 幻灯片2.html 幻灯片3.html 等等……
这些文件的结构是这样的:
<h2>Title of the Slide</h2>
<p><a href="http://mydomain.com"><img src="tick_icon.jpg" width="227" height="227" alt="icon" longdesc="http://longdescription" /></a></p>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
3 属性标题、图像和描述。每行一个。
我有大约 10 到 12 个这样的文件。我想要一个函数来循环和解析名为'slides' 的文件夹中的所有这些文件,并将每行(3 行)的值作为变量返回,以便我可以将它们放在我的代码中进行布局。
【问题讨论】:
-
您能否更准确地说明您希望如何处理 HTML?特别是,我不确定“每行的值”是什么意思。另外,你有首选的语言来写这个吗?