Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Replacing XML Values with XML::Simple

 
Michael Malley
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I've got a program that deals with both a word doc and an XML file. It uses Win32::OLE and XML::Simple. The XML file provides search strings to find in the word doc. When the search string is found, it's sister node, "value" needs to be changed from 0 to 1. I've read up on XML::Simple, but I'm not seeing where I'm going wrong here. Basically, in the section where I find the search string, it works, and I find the string, but I can't change the value node's value. The code where this is done is below:



XML DATA:
<?xml version='1.0'?>
<skills>
<skill>
<type>J2EE</type>
<value>0</value>
</skill>
<skill>
<type>SAN</type>
<value>0</value>
</skill>
<skill>
<type>Cisco</type>
<value>0</value>
</skill>
<skill>
<type>OPNet</type>
<value>0</value>
</skill>
</skills>

Thanks in advance!
 
Rob Hunter
Ranch Hand
Posts: 832
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You printed out the object using Dumper, could you run again with the Dumper print before and after the loop and also leave the prints in for where the string match is being done (to ensure the matches are occuring)? I don't know if I'll see the problem but I can certainly lend a second set of eyes. :-)
 
Michael Malley
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rob Hunter wrote:You printed out the object using Dumper, could you run again with the Dumper print before and after the loop and also leave the prints in for where the string match is being done (to ensure the matches are occuring)? I don't know if I'll see the problem but I can certainly lend a second set of eyes. :-)


Rob, thanks for your input on this. I actually decided to go a different way altogether, and didn't use XML::Simple. But thanks again.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic