Thread

Posted on Sun Sep 2 14:15:08 2007 by veikoh
Can I get some help?
After struggling few days with XML Simple I decided better to ask advice here as the documentation lacks simple examples. I'm started with Perl recently but I have long backgroung in IT programming using several languages. Rather than writing my own string manipulation code, XML Simple sounded good idea to use. The issue is to change the values of previous and next in XML file, both are URL's.
I have XML files with following structure: <item> .... <previous>...</previous> <next>...</next> </item> So currently I have written following codelines: my $btemplate = XMLin ("template_file.xml"); $prev = $btemplate -> {previous}; $btemplate -> {previous} = $link; XMLout ($btemplate); my $prevpage = XMLin ($prev); $prevpage -> {next} = $link; XMLout ($prevpage); The problem is, that $prev value is always empty and XMLout does not do anything. I tried also $btemplate -> {item => previous) but still have the same problem.
Maybe somebody here can help me I my code should look like? Veiko
Direct Responses: 6004 | Write a response
Posted on Sun Sep 2 23:40:17 2007 by grantm in response to 6003
Re: Can I get some help?
Direct Responses: 6062 | Write a response
Posted on Thu Sep 13 15:48:55 2007 by veikoh in response to 6004
Re: Can I get some help?
Thanks Grant for answering me. However, after playing another few days with parameters forcearray and keyattr I still didn't get any results and wrote some lines of string manipulation code within few hours. Also the problem was, that I'm using a shared UNIX hosting somewhere and do not see any error messages at all. So, using strict mode wasn't much helpful. Anyway, got the XMLOut finally to save the file as discovered outfile parameter. But the result was, that only the element I was modifying where stored as empty string and all other elements where deleted. Should it work this way? Veiko
Write a response