]> granicus.if.org Git - php/commitdiff
- renamed domxml_parser_reference to domxml_parser_entitiy_reference
authorChristian Stocker <chregu@php.net>
Fri, 14 Jun 2002 12:37:28 +0000 (12:37 +0000)
committerChristian Stocker <chregu@php.net>
Fri, 14 Jun 2002 12:37:28 +0000 (12:37 +0000)
- renamed domxml_cdata_block to domxml_parser_cdata_section
  (more consistent with the domxml_create_XXX methods)
- added domxml_parser_processing_instruction(target,data)
- added domxml_parser_namespace_decl(href,prefix)

ext/domxml/php_domxml.c
ext/domxml/php_domxml.h

index 10627f7ff71f15fffde02e69365db78b8057a0a3..eafb4822a3ab3ebce5b67e35c7b5f780f6bd71d7 100644 (file)
@@ -237,8 +237,10 @@ static zend_function_entry domxml_functions[] = {
        PHP_FE(domxml_parser_end_element,                                                                                       NULL)
        PHP_FE(domxml_parser_comment,                                                                                   NULL)
        PHP_FE(domxml_parser_characters,                                                                                        NULL)
-       PHP_FE(domxml_parser_reference,                                                                                 NULL)
-       PHP_FE(domxml_parser_cdata_block,                                                                                       NULL)
+       PHP_FE(domxml_parser_entity_reference,                                                                                  NULL)
+       PHP_FE(domxml_parser_processing_instruction,                                                                                    NULL)
+       PHP_FE(domxml_parser_cdata_section,                                                                                     NULL)
+       PHP_FE(domxml_parser_namespace_decl,                                                                                    NULL)
        PHP_FE(domxml_parser_start_document,                                                                                    NULL)
        PHP_FE(domxml_parser_end_document,                                                                                      NULL)
        PHP_FE(domxml_parser_get_document,                                                                                      NULL)
@@ -330,9 +332,11 @@ static function_entry php_domxmlparser_class_functions[] = {
        PHP_FALIAS(start_element,                               domxml_parser_start_element,            NULL)
        PHP_FALIAS(end_element,                         domxml_parser_end_element,              NULL)
        PHP_FALIAS(characters,                          domxml_parser_characters,               NULL)
-       PHP_FALIAS(reference,                           domxml_parser_reference,                NULL)
-       PHP_FALIAS(cdata_block,                         domxml_parser_cdata_block,              NULL)
+       PHP_FALIAS(entity_reference,                            domxml_parser_entity_reference,         NULL)
+       PHP_FALIAS(processing_instruction,                              domxml_parser_processing_instruction,           NULL)
+       PHP_FALIAS(cdata_section,                               domxml_parser_cdata_section,            NULL)
        PHP_FALIAS(comment,                             domxml_parser_comment,          NULL)
+       PHP_FALIAS(namespace_decl,                              domxml_parser_namespace_decl,           NULL)
        PHP_FALIAS(start_document,                              domxml_parser_start_document,           NULL)
        PHP_FALIAS(end_document,                                domxml_parser_end_document,             NULL)
        PHP_FALIAS(get_document,                                domxml_parser_get_document,             NULL)
@@ -4111,9 +4115,9 @@ PHP_FUNCTION(domxml_parser_comment)
 }
 /* }}} */
 
-/* {{{ proto bool domxml_parser_cdata_block(string chunk)
+/* {{{ proto bool domxml_parser_cdata_section(string chunk)
    adds a cdata block */
-PHP_FUNCTION(domxml_parser_cdata_block)
+PHP_FUNCTION(domxml_parser_cdata_section)
 {
        zval *id;
        xmlParserCtxtPtr parserp;
@@ -4155,9 +4159,9 @@ PHP_FUNCTION(domxml_parser_characters)
 }
 /* }}} */
 
-/* {{{ proto bool domxml_parser_reference(string reference)
+/* {{{ proto bool domxml_parser_entity_reference(string reference)
    Adds entity reference */
-PHP_FUNCTION(domxml_parser_reference)
+PHP_FUNCTION(domxml_parser_entity_reference)
 {
        zval *id;
        xmlParserCtxtPtr parserp;
@@ -4177,6 +4181,51 @@ PHP_FUNCTION(domxml_parser_reference)
 }
 /* }}} */
 
+/* {{{ proto bool domxml_parser_processing_instruction(string target, string data)
+   Adds processing instruction */
+PHP_FUNCTION(domxml_parser_processing_instruction)
+{
+       zval *id;
+       xmlParserCtxtPtr parserp;
+       char *data,*target;
+       int data_len, target_len;
+       
+       DOMXML_PARAM_FOUR(parserp, id, le_domxmlparserp,"ss", &target, &target_len, &data, &data_len);
+
+       if (parserp->myDoc == NULL) {
+               php_error(E_WARNING, "%s(): Document was not started", get_active_function_name(TSRMLS_C));
+               RETURN_FALSE;
+       }
+
+       processingInstruction(parserp, (xmlChar *) target, (xmlChar *) data);
+       
+       RETURN_TRUE;
+}
+/* }}} */
+
+/* {{{ proto bool domxml_parser_namespace_decl(string href, string prefix)
+   Adds namespace declaration */
+PHP_FUNCTION(domxml_parser_namespace_decl)
+{
+       zval *id;
+       xmlParserCtxtPtr parserp;
+       char *href,*prefix;
+       int href_len, prefix_len;
+       
+       DOMXML_PARAM_FOUR(parserp, id, le_domxmlparserp,"ss", &href, &href_len, &prefix, &prefix_len);
+
+       if (parserp->myDoc == NULL) {
+               php_error(E_WARNING, "%s(): Document was not started", get_active_function_name(TSRMLS_C));
+               RETURN_FALSE;
+       }
+
+       namespaceDecl(parserp, (xmlChar *) href, (xmlChar *) prefix);
+       
+       RETURN_TRUE;
+}
+/* }}} */
+
+
 /* {{{ proto bool domxml_parser_add_chunk(string chunk)
    adds xml-chunk to parser */
 PHP_FUNCTION(domxml_parser_add_chunk)
index de15d5bbd112640208da5643368c96ab4c941bce..c016dbdc05d5c6b0bbd2d7ec03fabd0f9f685405 100644 (file)
@@ -189,9 +189,11 @@ PHP_FUNCTION(domxml_parser_set_keep_blanks);
 PHP_FUNCTION(domxml_parser_start_element);
 PHP_FUNCTION(domxml_parser_end_element);
 PHP_FUNCTION(domxml_parser_characters);
-PHP_FUNCTION(domxml_parser_reference);
+PHP_FUNCTION(domxml_parser_entity_reference);
 PHP_FUNCTION(domxml_parser_comment);
-PHP_FUNCTION(domxml_parser_cdata_block);
+PHP_FUNCTION(domxml_parser_cdata_section);
+PHP_FUNCTION(domxml_parser_namespace_decl);
+PHP_FUNCTION(domxml_parser_processing_instruction);
 PHP_FUNCTION(domxml_parser_start_document);
 PHP_FUNCTION(domxml_parser_end_document);
 PHP_FUNCTION(domxml_parser_get_document);