root/branches/PRE_NAMESPACES/examples/TestCDataSetter.php

Revision 131, 1.0 kB (checked in by mikey, 1 year ago)

changed package separator from dot to Paamayim Nekudotayim

Line 
1 <?php
2 /**
3  * Example that shows how to use the cdata setter.
4  *
5  * @author  Stephan Schmidt <stephan.schmidt@schlund.de>
6  * @author  Frank Kleine <frank.kleine@schlund.de>
7  */
8 require_once '../XJConf/XJConfLoader.php';
9 XJConfLoader::load('DefinitionParser',
10                    'XmlParser',
11                    'ext::Extension'
12 );
13 require 'Complex2.php';
14 /**
15  * Example that shows how to use the cdata setter.
16  *
17  * @package     XJConf
18  * @subpackage  examples
19  */
20 class TestCDataSetter
21 {
22     public static function main()
23     {
24         $tagParser = new DefinitionParser();
25         $defs      = $tagParser->parse(getcwd() . '/xml/defines-set-cdata.xml');
26         $conf      = new XmlParser();
27         $conf->setTagDefinitions($defs);
28
29         try {
30             $conf->parse(getcwd() . '/xml/test-set-cdata.xml');
31         } catch (Exception $e) {
32             echo $e->getTraceAsString();
33             exit(0);
34         }
35
36         $c = $conf->getConfigValue('complex');
37         var_dump($c);
38     }
39 }
40 TestCDataSetter::main();
41 ?>
Note: See TracBrowser for help on using the browser.