<commit_before><?php

require_once 'XmlDOM.class.php';

$arr = array(
                  '@attributes' => array(
                  'type' => 'fiction'
                  ),
                  'book' => array(
                      array(
                        '@attributes' => array(
                              'author' => '<NAME>'
                         ),
                         'title' => '1984'
                      ),
                       array(
                        '@attributes' => array(
                              'author' => '<NAME>'
                         ),
                         'title' => 'S harmoniko po svetu'
                      ),
                      array(
                        '@attributes' => array(
                              'author' => '<NAME>'
                        ),
                         'title' => array('@cdata' => 'Foundation'),
                        'price' => '$15.61'
                      ),
                      array(
                        '@attributes' => array(
                              'author' => '<NAME>'
                        ),
                        'title' => array('@cdata' => 'Stranger in a Strange Land'),
                        'special' => array(
                                    array(
                                      '@attributes' => array(
                                          'discount' => '10%',
                                    ),
                                     '@value'=> '10$',
                                  ),
                        ),
                        'price' => '$43.29'
                      )
                  )//end of book
           ); //end of books

$dom = new XmlDOM('1.0', 'utf-8');
$dom->formatOutput = true;
$dom->generateXML($arr,'books');

$xml = $dom->saveXML();

echo $xml;
?><commit_msg>added more simple example<commit_after><?php

require_once 'XmlDOM.class.php';

//complex example
$arr = array(
                  '@attributes' => array(
                  'type' => 'fiction'
                  ),
                  'book' => array(
                      array(
                        '@attributes' => array(
                              'author' => '<NAME>'
                         ),
                         'title' => '1984'
                      ),
                       array(
                        '@attributes' => array(
                              'author' => '<NAME>'
                         ),
                         'title' => 'S harmoniko po svetu'
                      ),
                      array(
                        '@attributes' => array(
                              'author' => '<NAME>'
                        ),
                         'title' => array('@cdata' => 'Foundation'),
                        'price' => '$15.61'
                      ),
                      array(
                        '@attributes' => array(
                              'author' => '<NAME>'
                        ),
                        'title' => array('@cdata' => 'Stranger in a Strange Land'),
                        'special' => array(
                                    array(
                                      '@attributes' => array(
                                          'discount' => '10%',
                                    ),
                                     '@value'=> '10$',
                                  ),
                        ),
                        'price' => '$43.29'
                      )
                  )//end of book
           ); //end of books

$dom = new XmlDOM('1.0', 'utf-8');
$dom->formatOutput = true;
$dom->generateXML($arr,'books');

$xml = $dom->saveXML();

echo $xml;

//and more simple example
$arr = array(     'publishTime' => '18.01.2013 11:09:39',
                      'date' => '18.01.2013',
                      'title' => '18.01.2013',
                      'publish' => 'False',
                      'description' => 'delo',
      );

$dom = new XmlDOM('1.0', 'utf-8');
$dom->formatOutput = true;
$dom->generateXML($arr, 'issue');

$xml = $dom->saveXML();

echo $xml;

?>
{'fraction_non_alphanumeric': 0.13927105961863384, 'fraction_numerical': 0.017137340091720975, 'mean_word_length': 0.6893599673868732, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 73, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 6}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 14, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4176664', 'n_tokens_mistral': 1012, 'n_tokens_neox': 914, 'n_words': 190}