<?xml version="1.0" standalone="no"?>
<!--
 * Copyright 1999-2005 The Apache Software Foundation.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
-->

<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "http://forrest.apache.org/dtd/document-v20.dtd"
[
<!ENTITY % PROJECT-ENTITIES PUBLIC
   "-//Xerces-P//Xerces-P ENTITIES V1.0//EN//XML"
   "project-entities.ent">
%PROJECT-ENTITIES;
]>
<document> 
  <header> 
    <title>&PROJECT_NAME; Sample: DOM2Hash</title> 
  </header> 
  <body> 


<section>
<title>Sample: DOM2Hash</title>

    <section>
<title>DOM2Hash</title>

        <p> DOM2Hash, illustrates how to traverse a DOM tree in memory
        and convert that tree to a simple recursive hash table data
        structure.</p>

        <section>
<title>Running DOM2Hash</title>

          <p>The DOM2Hash sample illustrates how convert a DOM tree
             to another format. To run DOM2Hash, enter the following</p>
<source>perl DOM2Hash.pl  &lt;XML file&gt;</source>
          <p>Here is a sample output from DOM2Hash</p>
<source>perl DOM2Hash.pl roles.xml
<![CDATA[
$VAR1 = {
          'node_name' => 'contributors',
          'children' => [
                          {
                            'node_name' => 'person',
                            'attributes' => {
                                              'Role' => 'manager'
                                            }
                          }
                        ],
          'attributes' => {
                            'xmlns' => 'contributors'
                          }
        };
]]>
</source>

        </section>
    </section>
</section>
</body>
</document>