2014-02-13 45 views
1

我正在打开购物车中的多供应商扩展,我想对vqmod的XML文件进行更改。我想在我的一些文件中添加代码。我想添加的代码是在if和for语句之后,所以我需要搜索这些行并添加我的代码。但我刚开始知道XML不允许我在文件中搜索多行。任何人都可以帮助我,让我可以搜索这些行,然后添加我的代码。在xml文件中搜索多行

+0

引用看看'xpath'来完成,它会找到多个节点给你,一个Google搜索或两个节点应该设置你的权利。 –

+0

是关于通过PHP编辑XML文件还是仅仅使用文本编辑器手动编辑? – shadyyx

+0

我正在编辑xml文件,以便我可以在php文件中进行更改,如index.php。 – saurabh

回答

0

在这里阅读完整的vqmod维基https://code.google.com/p/vqmod/wiki/Scripting

你的任务可以使用搜索标签offest属性,从vqmod维基

Optional attribute "offset" to work with the position 
if the search position is before and offset 3 it will put the add data before the line, 3 lines above the searched line 
if the search position is after and offset 3 it will put the add data after the line, 3 lines below the searched line 
if the search position is replace and offset 3 it will remove the code from the search line and the next 3 lines and replace it with the add data 
if the search position is top and offset 3 it will put the code before the line, 3 lines below the top of the file 
if the search position is bottom and offset 3 it will put the code after the line, 3 lines above the bottom of the file