/lenasys/0.1

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/lenasys/0.1

« back to all changes in this revision

Viewing changes to trunk/CodeViewer/DomExample2/DomExample2.txt

  • Committer: Henrik G.
  • Date: 2013-03-26 23:22:55 UTC
  • Revision ID: henrik.gustavsson@his.se-20130326232255-ik6snyatlbkf3zs1
First seed of Lenasys ... Needs to be Organized Further

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<html>
 
2
<body>
 
3
<pre>
 
4
<?php
 
5
 
 
6
function HandleXmlError($errno, $errstr, $errfile, $errline)
 
7
{
 
8
                echo $errno." ".$errstr."<br>";
 
9
}
 
10
 
 
11
        $file = 'example1c.xml';
 
12
 
 
13
        $dom = new DomDocument;
 
14
        $dom->preserveWhiteSpace = FALSE;
 
15
        
 
16
        set_error_handler('HandleXmlError');
 
17
        $loadstate=$dom->load($file);
 
18
        if($loadstate){
 
19
                        $validatestate=$dom->validate();        
 
20
                        if($validatestate){
 
21
                                        echo "Validation successful!<br>";
 
22
                        }else{
 
23
                                        echo "Validation test failed!<br>";
 
24
                        }                       
 
25
        }else{
 
26
                        echo "Well-formedness test Failed!<br>";        
 
27
        }
 
28
        restore_error_handler();
 
29
        
 
30
?>
 
31
</pre>
 
32
</body>
 
33
</html>
 
 
b'\\ No newline at end of file'