<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">#!/usr/bin/perl

use XML::DT;
use Data::Dumper;

%handler = ( -default =&gt; sub{$c},
	     packages =&gt; sub{ [ split(",",$c)] },
             -type    =&gt; { vendorinfo =&gt; 'MAP',
                           paks       =&gt; 'SEQ' }
           ); 

$a = dtstring ("
  &lt;vendorinfo&gt;
    &lt;id&gt; netscape.com &lt;/id&gt; 
    &lt;id&gt; netscape.commmm&lt;/id&gt;
    &lt;name&gt; Netscape &lt;/name&gt; 
    &lt;status&gt; active &lt;/status&gt; 
    &lt;packages&gt; communicator-4.07, communicator-4.5, navigator-4.07 &lt;/packages&gt; 
  &lt;/vendorinfo&gt;",%handler);
    
print Dumper($a);         

$a = dtstring ("
  &lt;vendorinfo&gt;
    &lt;id&gt; netscape.com &lt;/id&gt; 
    &lt;id&gt; netscape.commmm&lt;/id&gt;
    &lt;name&gt; Netscape &lt;/name&gt; 
    &lt;status&gt; active &lt;/status&gt; 
    &lt;paks&gt; 
       &lt;item&gt;communicator-4.07 &lt;/item&gt;
       &lt;item&gt; communicator-4.5, &lt;/item&gt;
       &lt;item&gt; navigator-4.07 &lt;/item&gt; 
    &lt;/paks&gt; 
  &lt;/vendorinfo&gt;",%handler);

print Dumper($a);         
</pre></body></html>