xml-simple

Updating xml attribute value based on other with Perl

强颜欢笑 提交于 2019-11-28 12:56:45
This is my sample xml file <manifest> <default> <remote>remote1</remote> <revision>rev1</revision> </default> <project> <name>common</name> <path>opensource/device</path> <revision>sa</revision> <x-ship>oss</x-ship> </project> <project> <name>external</name> <path>source/tp</path> <x-ship>none</x-ship> </project> <project> <name>ws</name> <path>opensource/ws</path> <remote>nj</remote> <revision>myno</revision> <x-ship>none</x-ship> </project> </manifest> In this I need to update the value of revision only when <path> has "opensource" string in it. I searched a lot but couldn't find anything

Updating xml attribute value based on other with Perl

梦想与她 提交于 2019-11-27 07:19:54
问题 This is my sample xml file <manifest> <default> <remote>remote1</remote> <revision>rev1</revision> </default> <project> <name>common</name> <path>opensource/device</path> <revision>sa</revision> <x-ship>oss</x-ship> </project> <project> <name>external</name> <path>source/tp</path> <x-ship>none</x-ship> </project> <project> <name>ws</name> <path>opensource/ws</path> <remote>nj</remote> <revision>myno</revision> <x-ship>none</x-ship> </project> </manifest> In this I need to update the value of