]> granicus.if.org Git - php/commitdiff
allow NULL prefix to create default namespace
authorRob Richards <rrichards@php.net>
Fri, 9 Dec 2005 20:51:23 +0000 (20:51 +0000)
committerRob Richards <rrichards@php.net>
Fri, 9 Dec 2005 20:51:23 +0000 (20:51 +0000)
fix tests

ext/xmlwriter/php_xmlwriter.c
ext/xmlwriter/tests/009.phpt
ext/xmlwriter/tests/OO_009.phpt

index d773be3b4e376c45c463c331e3b9d3e185f6aa4f..ca6d54984faf1d84af584093d7e40776013e1016 100644 (file)
@@ -658,7 +658,7 @@ PHP_FUNCTION(xmlwriter_write_attribute_ns)
        
        if (this) {
                if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ssss", 
-                       &name, &name_len, &content, &content_len) == FAILURE) {
+                       &prefix, &prefix_len, &name, &name_len, &uri, &uri_len, &content, &content_len) == FAILURE) {
                        return;
                }
                XMLWRITER_FROM_OBJECT(intern, this);
@@ -743,7 +743,7 @@ PHP_FUNCTION(xmlwriter_start_element_ns)
        zval *this = getThis();
        
        if (this) {
-               if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sss",
+               if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s!ss",
                        &prefix, &prefix_len, &name, &name_len, &uri, &uri_len) == FAILURE) {
                        return;
                }
@@ -751,7 +751,7 @@ PHP_FUNCTION(xmlwriter_start_element_ns)
        } else
 #endif
        {
-               if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsss", &pind, 
+               if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs!ss", &pind, 
                        &prefix, &prefix_len, &name, &name_len, &uri, &uri_len) == FAILURE) {
                        return;
                }
@@ -839,7 +839,7 @@ PHP_FUNCTION(xmlwriter_write_element_ns)
        zval *this = getThis();
        
        if (this) {
-               if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ssss", 
+               if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s!sss", 
                        &prefix, &prefix_len, &name, &name_len, &uri, &uri_len, &content, &content_len) == FAILURE) {
                        return;
                }
@@ -847,7 +847,7 @@ PHP_FUNCTION(xmlwriter_write_element_ns)
        } else
 #endif
        {
-               if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rssss", &pind, 
+               if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs!sss", &pind, 
                        &prefix, &prefix_len, &name, &name_len, &uri, &uri_len, &content, &content_len) == FAILURE) {
                        return;
                }
index 2322b7c0baf63ce3dfeb594969ac76adeb50854d..9c00fe7b0e405d4b912285c1f6c4a6963bf876a8 100644 (file)
@@ -22,11 +22,11 @@ xmlwriter_write_pi($xw, 'php', 'echo "hello world"; ');
 xmlwriter_end_element($xw);
 xmlwriter_start_element($xw, 'cdata');
 xmlwriter_start_cdata($xw);
-xmlwriter_end_element($xw);
 xmlwriter_text($xw, '<>&"');
 xmlwriter_end_cdata($xw);
 xmlwriter_end_element($xw);
 xmlwriter_end_element($xw);
+xmlwriter_end_element($xw);
 xmlwriter_end_document($xw);
 // Force to write and empty the buffer
 $output = xmlwriter_flush($xw, true);
index 659cfc8d6d3c06f3cb5f552653eab13af772706c..bd5a33c6bdbb020324e757a0eb4cf3db4791704b 100644 (file)
@@ -23,11 +23,11 @@ $xw->writePi('php', 'echo "hello world"; ');
 $xw->endElement();
 $xw->startElement('cdata');
 $xw->startCdata();
-$xw->endElement();
 $xw->text('<>&"');
 $xw->endCdata();
 $xw->endElement();
 $xw->endElement();
+$xw->endElement();
 $xw->endDocument();
 // Force to write and empty the buffer
 $output = $xw->flush(true);