Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Can someone pls suggest a PERL script in which i can replace a string from a xml file to the html file?
Eg:
XML FILE:
<topic id="1008" title="Overview" href="HelpEnglish.htm#Overview"/>
<group title="User Interface" href="HelpEnglish.htm#USER_INTERFACE">
<group title="The Menu Bar" href="HelpEnglish.htm#The_Menu_Bar">
<topic id="1009" title="The File Menu" href="HelpEnglish.htm#The_File_Menu"/>
<topic id="1010" title="New Project" href="HelpEnglish.htm#New_Project"/>
<topic id="1011" title="Open Project" href="HelpEnglish.htm#Open_Project"/>
<topic id="1012" title="Recent Files" href="HelpEnglish.htm#Recent_Projects"/>
<topic id="1013" title="Save Project" href="HelpEnglish.htm#Save_Project"/>
<topic id="1014" title="Save As" href="HelpEnglish.htm#Save_As"/>
<topic id="1015" title="Close Project" href="HelpEnglish.htm#Close_Project"/>
<topic id="1016" title="Import Old Project" href="HelpEnglish.htm#Import_Old_Project"/>
<topic id="1017" title="Merge Project" href="HelpEnglish.htm#Merge_Project"/>
<topic id="1018" title="Split Project" href="HelpEnglish.htm#Split_Project"/>
<topic id="1019" title="Exit" href="HelpEnglish.htm#Exit"/>
</group>HTML FILE:
<p class=MsoToc4><span class=MsoHyperlink>3.1.1.5<span
style='font-size:12.0pt;color:windowtext;text-decoration:none'>
</span>Save As<span style='color:windowtext;display:none;text-decoration:none'>.
19</span></span></p><p class=MsoToc4><span class=MsoHyperlink><a
href="HelpEnglish.htm#Close_Project">3.1.1.6<span style='font-size:12.0pt;
color:windowtext;text-decoration:none'> </span>Close
Project<span style='color:windowtext;display:none;text-decoration:none'> 19</span></span></p><p class=MsoToc4><span class=MsoHyperlink><a
href="HelpEnglish.htm#Import_Old_Project">3.1.1.7<span style='font-size:12.0pt;
color:windowtext;text-decoration:none'> </span>Import
Old Project<span style='color:windowtext;display:none;text-decoration:none'> 19</span></span></p><p class=MsoToc4><span class=MsoHyperlink><a
href="HelpEnglish.htm#Merge_Project">3.1.1.8<span style='font-size:12.0pt;
color:windowtext;text-decoration:none'> </span>Merge
Project<span style='color:windowtext;display:none;text-decoration:none'> 20</span></span></p><p class=MsoToc4><span class=MsoHyperlink><a
href="HelpEnglish.htm#Split_Project">3.1.1.9<span style='font-size:12.0pt;
color:windowtext;text-decoration:none'> </span>Split
Project<span style='color:windowtext;display:none;text-decoration:none'> 23</span></span></p><p class=MsoToc4><span class=MsoHyperlink>3.1.1.10<span
style='font-size:12.0pt;color:windowtext;text-decoration:none'>
</span>Exit<span style='color:windowtext;display:none;text-decoration:none'> 25</span></span></p>I want that from the xml file the "href" value should be replaced in the html file where the title is same.....can someone pls suggest a script as this is very urgent.....

There are no prewritten Perl scripts that will do what you want. You will need to write you own. There are a number of XML parser modules on cpan that will help in parsing the xml file and there are also some HTML parsers.
http://search.cpan.org/modlist/Stri...
http://search.cpan.org/modlist/Worl...What have you tried?

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |