Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
从一个打开的列表中获取图像路径列表,并使用记事本将它们粘贴到XML模板中++_Xml_Notepad++ - Fatal编程技术网

从一个打开的列表中获取图像路径列表,并使用记事本将它们粘贴到XML模板中++

从一个打开的列表中获取图像路径列表,并使用记事本将它们粘贴到XML模板中++,xml,notepad++,Xml,Notepad++,我有一个随机的URL图像链接列表: image1: images/DecWhiteGlitter29121305.jpg image2: images/DecWhiteGlitter29121302.jpg image3: images/DecWhiteGlitter29121306.jpg image4: images/DecWhiteGlitter29121399.jpg image5: images/DecWhiteGlitter29121301.jpg image6: images/De

我有一个随机的URL图像链接列表:

image1: images/DecWhiteGlitter29121305.jpg
image2: images/DecWhiteGlitter29121302.jpg
image3: images/DecWhiteGlitter29121306.jpg
image4: images/DecWhiteGlitter29121399.jpg
image5: images/DecWhiteGlitter29121301.jpg
image6: images/DecWhiteGlitter29121307.jpg
...
我需要将它们插入一个时事通讯XML模板中,该模板看起来很简单。Image1应转到第一个图像链接,Image2应转到第二个图像链接,等等:

<img class="aligncenter" alt="" src="link of image1" width="720" />
.....
<img class="aligncenter" alt="" src="link of image2" width="720" />
理想情况下,它应该获取第一个图像路径并将其粘贴到XML模板中的第一个URL图像链接,然后转到第二个图像路径并将其粘贴到第二个URL图像链接,等等


我不知道这是不是可以用宏自动完成的,比如说?

你的问题并没有让人马上明白你想要的自动化程度。但您的链接示例xml文件似乎有很多明显的重复。这种重复需要在图像源列表及其路径中的每个项目上进行

您不能只使用预先制作的位置列表来创建xml,以便将图像的源列表放入其中。这是不对的。使用适当的模板语言,或者使用下面的解决方案,并根据需要对其进行自定义

在记事本中按ctrl+f打开“查找和替换”窗口选项卡。 勾选单选项正则表达式 在“查找内容”文本框中输入以下表达式:

\w+:\s+*

在“替换为”文本框中,输入以下内容:

你的最终结果是什么

<img class="aligncenter" alt="image1" src="images/DecWhiteGlitter29121305.jpg" width="720" />
<img class="aligncenter" alt="image2" src="images/DecWhiteGlitter29121302.jpg" width="720" />
<img class="aligncenter" alt="image3" src="images/DecWhiteGlitter29121306.jpg" width="720" />
<img class="aligncenter" alt="image4" src="images/DecWhiteGlitter29121399.jpg" width="720" />
<img class="aligncenter" alt="image5" src="images/DecWhiteGlitter29121301.jpg" width="720" />
<img class="aligncenter" alt="image6" src="images/DecWhiteGlitter29121307.jpg" width="720" />

您的原始XML是否具有某种图像映射?与您的示例一样,src=image1的链接。如果是这样的话,我想我有一个解决办法。