2014-02-13 47 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