[Xml-compile] Mixed content question

Mark Overmeer mark at overmeer.net
Fri Feb 27 14:53:29 GMT 2009


* Petar Shangov (pshangov at yahoo.com) [090227 14:46]:
 <parent><mixed_child>Some Text</mixed_child></parent>'
 $xml_hash->{parent}{mixed_child}{_} = XML::LibXML::Text->new("Some Text"), but this produces '<parent>Some Text</parent>' instead, which is not what I need. 
> 

When you create your own XML::LibXML nodes, you have no checks.  In this
case, you produce the wrong node:

   # untested:
   my $mixed = $doc->createElement('mixed_child');
   $mixed->appendText('Some text');
   $xml_hash->{parent}{mixed_child}{_} = $mixed;

-- 
Regards,

               MarkOv

------------------------------------------------------------------------
       Mark Overmeer MSc                                MARKOV Solutions
       Mark at Overmeer.net                          solutions at overmeer.net
http://Mark.Overmeer.net                   http://solutions.overmeer.net




More information about the Xml-compile mailing list