XML : Getting full XML string from PERL LibXML Parser

I am having following XML which I required to process

  <table>  <col1>check1</col1>  <col2>check2</col2>  <col3>check3</col3>  <content>      <data>gt1</data>      <data>check_gt1</data>  </content>  </table>    

I want to get "<content><data>gt1</data><data>check_gt1</data></content>" from the parser.

My parsing code is as follows,

  my $parser = XML::LibXML->new();  my $respDom = $parser->parse_string($xmldata);  print "content is ".$respDom->getDocumentElement->findnodes("//content");    

The above code results in the textContent inside the nodes.How can I get the data I mentioned above ?

No comments:

Post a Comment