Bad MS! structor_test.php RE: [PEAR-DEV] XML Structor Finished
| From: | Robert Kelly | Date: | Wed, 23 May 2001 20:19:04 +0000 |
| Subject: | Bad MS! structor_test.php RE: [PEAR-DEV] XML Structor Finished | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-470@lists.php.net to get a copy of this message | ||
<HTML>
<HEAD>
<TITLE>XML Structor</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<?php
$file = "./foo.xml" ;
require_once ( "XML/struct.php" );
$struct = new XML_Structor ( );
$struct->setInputFile ( $file );
$struct->_debug = 0;
$struct->struct(); // parse
?>
<P><b>Test One:</b><br> echoing a parsed version of the XML file that
matches the input</P>
<?php
$struct->makeTree(); // parse
$struct->setPrintMode ( STRUCT_PRINTMODE_ASCII );
$struct->printTree ();
#$struct->tree[0]->dumpNode();
echo "</pre>";
?>
<P><b>Test Two:</b><br> Print Children of the Tree</P>
<?php
echo "<pre>";
$struct->tree[0]->getChildren($nodes);
foreach ( $nodes as $node ) {
echo $node->tag;
if ( count ( $node->attributes) ){
echo " ID = " . $node->attributes["ID"] ;
}
echo "\n";
}
echo "</pre>";
?>
<P><b>Test Three:</b><br> Simple Fetch <br> looking for tag OPEN val
SKINCLUDE</P>
<?php
echo "<pre>";
echo "Fetchmode ". $struct->displayFetchMode() ."\n";
$nodes = $struct->fetchRecord ( "OPEN", "SKINCLUDE" );
foreach ( $nodes as $node ) {
$node->dumpNode();
}
echo "</pre>";
?>
<P><b>Test Four:</b><br> Simple Fetch with Change of FETCHMODE<br>
Fetch tag
OPEN, value SKINCLUDE </P>
<?php
echo "<pre>";
$struct->fetchmode = STRUCT_FETCHMODE_OBJECT;
echo "Fetchmode ". $struct->displayFetchMode() ."\n";
$nodes = $struct->fetchRecord ( "OPEN", "SKINCLUDE" );
echo "Class:". gettype ($nodes) . "\n" ;
$node->dumpNode();
echo "</pre>";
?>
</body>
</html>
-----Original Message-----
From: Martin Jansen [mailto:mj@php.net]
Sent: Wednesday, May 23, 2001 12:44 PM
To: Markus Fischer
Cc: Robert Kelly; pear-dev@lists.php.net
Subject: Re: [PEAR-DEV] XML Structor Finished
On Wed, 23 May 2001 21:42:24 +0200, Markus Fischer wrote:
>Am I the only one who got no attachments with this mail, just
>
> <<structor.php>> <<structor_test.php>>
>
>??
No, you aren't. Seemingly it's because of the strange
format Robert's strange mailclient uses ;-).
- Martin