<?xml version="1.0" encoding="windows-1252"?>
<node id="918049" title="Re^3: rough start of an axml compiler" created="2011-08-02 09:06:17" updated="2011-08-02 09:06:17">
<type id="11">
note</type>
<author id="34613">
Boldra</author>
<data>
<field name="doctext">
Have you considered leaving the untagged content as plain text?
&lt;c&gt;
my @nodes = (
 bless ( {
    'tag' =&gt; 'html',
    'data' =&gt; [ bless ( {
                  'tag' =&gt; 'head',
                 'data' =&gt;  bless ( { 
                             'tag' =&gt; 'title',
                            'data' =&gt; 'acme products' }, 'Node' ),

                bless ( {
                  'tag' =&gt; 'body',
                 'data' =&gt; [ 'some orphan text that needs to be in the output',
                             bless ( { 
                               'tag' =&gt; 'use'
                              'data' =&gt; [ bless ( {
                                            'tag' =&gt; 'orphan',
                                           'data' =&gt; 'action/'}, 'Node' ),

                                          bless ( {
                                            'tag' =&gt; 'qd'
                                           'data' =&gt; 'action' }, 'Node' ),
 
                                          bless ( {
                                            'tag' =&gt; 'orphan',
                                           'data' =&gt; '/main.aXML' }, 'Node' )
                                        ] }, 'Node' )
                             'some more orphan text',
                            ] }, 'Node' )
             ] }, 'Node' )
        );
&lt;/c&gt;
and it may interest you that with Moose buildargs, you can easily set up the Node constructor to expect a tag and data, e.g. &lt;tt&gt;Node-&gt;new( qd =&gt; 'action' );&lt;/tt&gt;.  The output of Data::Dumper would still contain the &lt;tt&gt;bless { }, 'Node'&lt;/tt&gt; syntax, making it a good place to do debugging and testing.
&lt;c&gt;
my @nodes = (
    Node-&gt;new(
        html =&gt; [
            Node-&gt;new(
                head =&gt; Node-&gt;new( title =&gt; 'acme products' ),
            ),
            Node-&gt;new(
                body =&gt; [
                    'some orphan text that needs to be in the output',
                    Node-&gt;new( use =&gt; [
                        'actions/',
                        Node-&gt;new( qd =&gt; 'action'),
                        '/main.aXML',
                    ),
                    'some more orphan text',
                ],
            ),
        ]
    ),
);
&lt;/c&gt;
but then why make nodes out of plain html if you have no action planned for them?  Checking whether a tag is implemented during parsing is going to save you headaches later.
&lt;c&gt;
my @nodes = (
    '&lt;html&gt;
      &lt;head&gt;&lt;title&gt;acme products&lt;/title&gt;&lt;/head&gt;
      &lt;body&gt;
        some orphan text that needs to be in the output',
        Node-&gt;new( use =&gt; [ 'actions/', Node-&gt;new( qd =&gt; 'action' ), '/main.aXML' ] ),
        'some more orphan text
      &lt;/body&gt;
    &lt;/html&gt;',
)

&lt;/c&gt;
with which &lt;tt&gt;print @nodes&lt;/tt&gt; would just &lt;i&gt;do the right thing&lt;/i&gt;.</field>
<field name="root_node">
915797</field>
<field name="parent_node">
918040</field>
</data>
</node>
