php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #21907 Fatal error: Call to undefined function: get_attribute_node()
Submitted: 2003-01-27 12:17 UTC Modified: 2003-03-04 11:57 UTC
From: ddepill1 at ta dot telecom dot com dot ar Assigned:
Status: Closed Package: DOM XML related
PHP Version: 4.2.3 OS: Solaris 5.7
Private report: No CVE-ID: None
 [2003-01-27 12:17 UTC] ddepill1 at ta dot telecom dot com dot ar
Hi, my name is Damian.

I'm programming in php and i'm using DOMXML in SOLARIS 5.7 (Apache 1.3.27).
I have the next problem:
I build a XML document with a function, and then i try to parse this document with DOM XML, but sometimes i have a problem. In the web appear this error:

Fatal error: Call to undefined function: get_attribute_node() 

This error is random, sometimes is work ok, and somtimes i have this error.

Have u got any information about that ???

This is my code:

<?
	session_start(); /* Inicio la sesion */
?>

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>Pagina nueva 1</title>
<base target="principal">
<link rel="stylesheet" href="/style.css" type="text/css">
</head>

<body bgcolor="#00005B">

<?
	$start=10;
	$delta=20;
	$nivel=0;
	
	/* Abre el documento */
	$doc = domxml_open_mem($documento_domxml);
	if(isset($variable_metodo_get)){
			$elemento_metodo_get=$doc->get_elements_by_tagname ($variable_metodo_get);
			$atributo_desplegado_elemento_metodo_get=$elemento_metodo_get[0]->get_attribute_node("DESPLEGADO");
			if($atributo_desplegado_elemento_metodo_get->value() == "FALSE"){
						$elemento_metodo_get[0]->set_attribute("DESPLEGADO", "TRUE");
						} else{
									$elemento_metodo_get[0]->set_attribute("DESPLEGADO", "FALSE");
									}
			$documento_domxml=$doc->dump_mem(true);
			}
			
	
	/* Obtengo el elemento root */
	$root=$doc->document_element();	
	
	/* Obtengo los hijos de root */
	$child_root=$root->child_nodes();
	
	imprime_menu($root,count($child_root),$PHP_SELF,$start,$delta,$nivel); /* Imprimo el menu */

	/* Funcion recursiva */
	function imprime_menu($elemento_padre,$cant_hijos,$pagina_actual,$layer_start,$layer_delta,$nivel_func) 
		{ 
		/* Obtengo los hijos del padre */
		$hijos=$elemento_padre->child_nodes();
//		echo "Tiene ".$cant_hijos." hijos<BR>";		
		for( $i = 0 ;  $i < $cant_hijos ; $i++){
//				echo "i=".$i."<BR>";
				$atributo_desplegado=$hijos[$i]->get_attribute_node("DESPLEGADO");
				$atributo_nombre_menu=$hijos[$i]->get_attribute_node("NOMBRE_MENU");
				$atributo_tipo=$hijos[$i]->get_attribute_node("TIPO");
				if( $atributo_tipo->value() == "LINK") $atributo_path=$hijos[$i]->get_attribute_node("PATH");
								
//				echo "Menu : ".$atributo_nombre_menu->value()."	(TIPO -> ".$atributo_tipo->value().")<BR> Valor: ".$atributo_desplegado->value()."<BR>";
?>				
				<div id="Layer<? echo $layer_start; ?>" style="position:absolute; width:<?
				if($atributo_tipo->value() == "MENU") echo 140 - 6 * $nivel_func;
							else echo 140 - 6 * ($nivel_func + 1); ?>px; height:<? echo $layer_delta; ?>px; z-index:1; left: <?
				if($atributo_tipo->value() == "MENU") echo 6 * $nivel_func + 6;
							else echo 6 * ($nivel_func + 1) + 6; ?>px; top: <? echo $layer_start; $layer_start=$layer_start + $layer_delta; ?>px"><b><a href="
<?
				if($atributo_tipo->value() == "MENU"){
							echo $pagina_actual."?variable_metodo_get=".$hijos[$i]->node_name();
							}else{
									/* Es un Link */
									echo $atributo_path->value();
										}
?>	
	"onMouseOver="self.status='<? echo $atributo_nombre_menu->value(); ?>'; return true" onMouseOut="self.status=''; return true"  class="<?
	if($atributo_tipo->value() == "MENU") echo "carpeta";
	else echo "link"; ?>" target="<? if($atributo_tipo->value() == "MENU") echo "_self";
	else echo "principal"; ?>">
<?   	if($atributo_tipo->value() == "MENU" && $atributo_desplegado->value() == "TRUE") echo " - ";
		if($atributo_tipo->value() == "MENU" && $atributo_desplegado->value() == "FALSE") echo " + ";
		echo $atributo_nombre_menu->value(); ?>	</a></b></div>
<?
		if($atributo_desplegado->value() == "TRUE"){
					$layer_start=imprime_menu($hijos[$i],count($hijos[$i]->child_nodes()),$pagina_actual,$layer_start,$layer_delta,$nivel_func+1); /* Imprimo los hijos */
					}
				}
		return $layer_start;
		} 
?>

</body>

</html> 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-01-28 12:01 UTC] ddepill1 at ta dot telecom dot com dot ar
U send me an email with u feedback:

Please try using this CVS snapshot:

http://snaps.php.net/php4-STABLE-latest.tar.gz

I try to install this version of PHP, with the next configuration:

./configure --with-apache=./../../Apache/apache_1.3.27 \
   --with-dom\
   --with-oci8=/Persa/Oracle \
   --with-gd \
   --with-freetype-dir \
   --enable-gd-native-ttf \
   --enable-gd-imgstrttf \
   --with-png-dir \
   --with-zlib \
   --enable-track-vars

And when i ejecute make... i retrive this error:

In file included from /opt/php/php4-STABLE-200301281230/main/php_scandir.c:20:
/opt/php/php4-STABLE-200301281230/main/php_scandir.h:15: warning: `struct dirent' declared inside parameter list
/opt/php/php4-STABLE-200301281230/main/php_scandir.h:15: warning: its scope is only this definitionor declaration, which is probably not what you want.
/opt/php/php4-STABLE-200301281230/main/php_scandir.h:19: warning: `struct dirent' declared inside parameter list
/opt/php/php4-STABLE-200301281230/main/php_scandir.c:44: conflicting types for `alphasort'
/opt/php/php4-STABLE-200301281230/main/php_scandir.h:15: previous declaration of `alphasort'
/opt/php/php4-STABLE-200301281230/main/php_scandir.c:51: conflicting types for `scandir'
/opt/php/php4-STABLE-200301281230/main/php_scandir.h:19: previous declaration of `scandir'
/opt/php/php4-STABLE-200301281230/main/php_scandir.c: In function `scandir':
/opt/php/php4-STABLE-200301281230/main/php_scandir.c:104: warning: passing arg 4 of `qsort' from incompatible pointer type
make: *** [main/php_scandir.lo] Error 1


What can i do to resolve my problem ???

Thanks,

           Damian.-
 [2003-01-28 12:14 UTC] sniper@php.net
Please try newer snapshot, this compiler error should
be fixed now.

 [2003-01-29 07:22 UTC] ddepill1 at ta dot telecom dot com dot ar
I try with the snapshot php4-STABLE-200301282030, and when i execute make, appear this error:


In file included from /opt/php/php4-STABLE-200301282030/main/php_scandir.c:20:
/opt/php/php4-STABLE-200301282030/main/php_scandir.h:15: warning: `struct dirent' declared inside pa
rameter list
/opt/php/php4-STABLE-200301282030/main/php_scandir.h:15: warning: its scope is only this definition
or declaration, which is probably not what you want.
/opt/php/php4-STABLE-200301282030/main/php_scandir.h:19: warning: `struct dirent' declared inside pa
rameter list
/opt/php/php4-STABLE-200301282030/main/php_scandir.c:46: conflicting types for `alphasort'
/opt/php/php4-STABLE-200301282030/main/php_scandir.h:15: previous declaration of `alphasort'
/opt/php/php4-STABLE-200301282030/main/php_scandir.c:53: conflicting types for `scandir'
/opt/php/php4-STABLE-200301282030/main/php_scandir.h:19: previous declaration of `scandir'
/opt/php/php4-STABLE-200301282030/main/php_scandir.c: In function `scandir':
/opt/php/php4-STABLE-200301282030/main/php_scandir.c:106: warning: passing arg 4 of `qsort' from inc
ompatible pointer type
make: *** [main/php_scandir.lo] Error 1
 [2003-02-04 17:30 UTC] sniper@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php4-STABLE-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-STABLE-latest.zip


The compile error should really be fixed now.
If it still persists, let us know what compiler/version
you're using.

 [2003-02-19 04:38 UTC] sniper@php.net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.


 [2003-03-04 11:57 UTC] chregu@php.net
No feedback provided. Bug closed.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon May 27 13:01:31 2024 UTC