<div dir="ltr"><div><div><div><div><div>Hi,<br><br></div>I am facing issue while reading an xml and updating to diff xml.<br></div>The thing is both files is in diff format. So I am not aware if XML transformation is feasible.<br>
<br></div><br>here is my attempt--

<p class=""><tt class=""><font size="-1">my $parser = XML::LibXML->new();<br>
$doc = $parser->parse_file("input.xml");<br>
my $appName = $doc->findvalue(q|@name|);<br>
</font></tt></p>


So I have slurp whole file into $doc. 

Same way I have opened output.xml (complex one ) and did this way.
<p class=""><tt class=""><font size="-1"> use XML::LibXML;<br>
 my $parser = XML::LibXML->new();<br>
 my $doc    = $parser->parse_file("output.xml");<br>
<br>
  my $query  = "//anonotaion";<br>
<br>
  my($node)  = $doc->findnodes($query);<br>
  $node->setData('$appname');<br>
<br>
  print $doc->toString;<br>
<br>
</font></tt></p>


output.xml format is completely different from input.xml. I would like to know if there is any good way to achieve this.
<br>
fraction of xmls is --<br><br>
__input.xml__
<p class=""><tt class=""><font size="-1"><appliance long_name ="my app name" revision="10.58.226.13"><br>
<desciption_section><br>
<annotation>template</annotation><br>
<add_eula enabled="1"><br>
<description>EULA LICENSE AGREEMENT</description><br>
</add_eula><br>
<welcome_screen enabled="1">welcome to my app </welcome_screen><br>
</desciption_section><br>
.....<br>
</font></tt></p>


__output.xml__
<tt class=""><font size="-1"><br><br><?xml version="1.0" encoding="utf-8"?><br>
<ovf:Envelope xmlns:xsi="<a href="http://www.w3.org/2001/XMLSchema-instance">http://www.w3.org/2001/XMLSchema-instance</a>" 
xmlns:vadk="<a href="http://www.vmware.com/schema/vadk">http://www.vmware.com/schema/vadk</a>" 
xmlns:ovf="<a href="http://schemas.dmtf.org/ovf/envelope/1">http://schemas.dmtf.org/ovf/envelope/1</a>" 
xmlns:vssd="<a href="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData">http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData</a>"
 
xmlns:rasd="<a href="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData</a>"
 xmlns:vmw="<a href="http://www.vmware.com/schema/ovf">http://www.vmware.com/schema/ovf</a>" 
xmlns:vsm="<a href="http://www.vmware.com/schema/vServiceManager">http://www.vmware.com/schema/vServiceManager</a>" 
xsi:schemaLocation="<a href="http://schemas.dmtf.org/ovf/envelope/1">http://schemas.dmtf.org/ovf/envelope/1</a> 
/opt/vmware/etc/build/schemas/vadk.xsd" ovf:version="0.7.0" 
vadk:version="2.6.0.0"><br>
    <References><br>
        <File ovf:href="system.vmdk" ovf:id="system.vmdk_id"/><br>
    </References><br>
<!--<br>
        The Annotation element of the AnnotationSection_Type is the text<br>
        that will be presented as the Description of the VM.<br>
    --><br>
    <Section xsi:type="ovf:AnnotationSection_Type"><br>
        <Info/><br>
        <Annotation>new app</Annotation><br>
    </Section><br>
    <Section xsi:type="ovf:ProductSection_Type" ovf:required="false"><br>
        <Info>branding information</Info><br>
        <Product>OvMabk</Product><br>
        <Vendor></Vendor><br>
<br>
....<br><br></font></tt></div><tt class=""><font size="-1">Thanks for the help..<br><br></font></tt></div><tt class=""><font size="-1">Prashant<br>
</font></tt><div><div><div><br></div></div></div></div>