chregu          Mon Feb 23 10:55:16 2004 EDT

  Added files:                 
    /php-src/ext/xml/tests      xml010.phpt 
  Log:
  test for attributes
  
  

http://cvs.php.net/co.php/php-src/ext/xml/tests/xml010.phpt?r=1.1&p=1
Index: php-src/ext/xml/tests/xml010.phpt
+++ php-src/ext/xml/tests/xml010.phpt
--TEST--
XML parser test, attributes
--FILE--
<?php
function start_elem($parser,$name,$attribs) {
        print "$name ";
    
    foreach($attribs as $key => $value) {
        print "$key = $value ";
    }
    print "\n";
}
function end_elem()
{
}

$xml = <<<HERE
<a xmlns="http://example.com/foo";
    xmlns:bar="http://example.com/bar";>
  <bar:b foo="bar"/>
  <bar:c bar:nix="null" foo="bar"/>
</a>
HERE;

$parser = xml_parser_create_ns("ISO-8859-1","@");
xml_set_element_handler($parser,'start_elem','end_elem');
xml_parser_set_option($parser,XML_OPTION_CASE_FOLDING,0);
xml_parse($parser, $xml);
xml_parser_free($parser);
?>
--EXPECT--
http://example.com/[EMAIL PROTECTED] 
http://example.com/[EMAIL PROTECTED] foo = bar 
http://example.com/[EMAIL PROTECTED] http://example.com/[EMAIL PROTECTED] = null foo = 
bar

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to