473,421 Members | 1,627 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,421 software developers and data experts.

PHP Version 4.3.10 - Warning: domdocument() expects at least 1 parameter, 0 given

Hiya folks,

I'm getting the following error(s) below and I'm at a bit of a loss as
to how to correct it. When I give it a parameter it then complains it
needs two parameters and the second one being an integer or something
like that.

Warning: domdocument() expects at least 1 parameter, 0 given in
orders.php on line 157

Warning: domdocument() expects at least 1 parameter, 0 given in
orders.php on line 158

Fatal error: Call to undefined function: loadxml() in orders.php on
line 159

The lines in question are:
$xml = new DOMDocument;
$xsl = new DOMDocument;
$xml->loadXML($row['fetch_orders']);
$xsl->load('fetch_orders.xsl');
$proc = new xsltprocessor;

phpinfo shows the following:
Loaded Modules: mod_php4, mod_setenvif, mod_so, mod_unique_id,
mod_log_forensic, mod_usertrack, mod_headers, mod_expires,
mod_cern_meta, mod_proxy, mod_digest, mod_auth_db, mod_auth_anon,
mod_auth, mod_access, mod_rewrite, mod_alias, mod_userdir, mod_speling,
mod_actions, mod_imap, mod_asis, mod_cgi, mod_dir, mod_autoindex,
mod_include, mod_info, mod_status, mod_negotiation, mod_mime,
mod_mime_magic, mod_log_config, mod_define, mod_env, mod_vhost_alias,
mod_mmap_static, http_core

domxml
DOM/XML enabled
DOM/XML API Version 20020815
libxml Version 20616
HTML Support enabled
XPath Support enabled
XPointer Support enabled
DOM/XSLT enabled
libxslt Version 1.1.12
libxslt compiled against libxml Version 2.6.16
DOM/EXSLT enabled
libexslt Version 1.1.12

xml
XML Support active
XML Namespace Support active
EXPAT Version expat_1.95.8

xslt
XSLT support enabled
Backend Sablotron
Sablotron Version 1.0.1
Sablotron Information Cflags: -O -pipe Libs: -L/usr/local/lib -liconv
-lexpat Prefix: /usr/local

Jul 17 '05 #1
1 12837

Mini Mouse wrote:
Hiya folks,

I'm getting the following error(s) below and I'm at a bit of a loss as to how to correct it. When I give it a parameter it then complains it
needs two parameters and the second one being an integer or something
like that.

Warning: domdocument() expects at least 1 parameter, 0 given in
orders.php on line 157

Warning: domdocument() expects at least 1 parameter, 0 given in
orders.php on line 158

Fatal error: Call to undefined function: loadxml() in orders.php on
line 159

The lines in question are:
$xml = new DOMDocument;
$xsl = new DOMDocument;
$xml->loadXML($row['fetch_orders']);
$xsl->load('fetch_orders.xsl');
$proc = new xsltprocessor;

phpinfo shows the following:
Loaded Modules: mod_php4, mod_setenvif, mod_so, mod_unique_id,
mod_log_forensic, mod_usertrack, mod_headers, mod_expires,
mod_cern_meta, mod_proxy, mod_digest, mod_auth_db, mod_auth_anon,
mod_auth, mod_access, mod_rewrite, mod_alias, mod_userdir, mod_speling, mod_actions, mod_imap, mod_asis, mod_cgi, mod_dir, mod_autoindex,
mod_include, mod_info, mod_status, mod_negotiation, mod_mime,
mod_mime_magic, mod_log_config, mod_define, mod_env, mod_vhost_alias,
mod_mmap_static, http_core

domxml
DOM/XML enabled
DOM/XML API Version 20020815
libxml Version 20616
HTML Support enabled
XPath Support enabled
XPointer Support enabled
DOM/XSLT enabled
libxslt Version 1.1.12
libxslt compiled against libxml Version 2.6.16
DOM/EXSLT enabled
libexslt Version 1.1.12

xml
XML Support active
XML Namespace Support active
EXPAT Version expat_1.95.8

xslt
XSLT support enabled
Backend Sablotron
Sablotron Version 1.0.1
Sablotron Information Cflags: -O -pipe Libs: -L/usr/local/lib -liconv -lexpat Prefix: /usr/local
Did the research on this and since I didn't get any responses I found
that I had to change the code in order to resolve it. Seems that
there's something funky in php4 domxml, but why I don't know.
The lines in question are:
$xml = new DOMDocument;
$xsl = new DOMDocument;
$xml->loadXML($row['fetch_orders']);
$xsl->load('fetch_orders.xsl');
$proc = new xsltprocessor;


The new lines are:
$xml = new Domdocument($row['fetch_order']);
$xsl=domxml_xslt_stylesheet_file("fetch_order.xsl" );
//Actually on the above line you may need to put in the full path.
$output = $xsl->process($xml);
echo $output->dump_mem();

Another way would be something like this:
$sql = "select fetch_orders('$who')";
$result = pg_query($sql);
$row = pg_fetch_array($result);
$xml=domxml_open_mem($row['fetch_orders']);
$xsl=domxml_xslt_stylesheet_file('fetch_orders.xsl ');
$output = $xsl->process($xml);
echo $output->dump_mem();

Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

35
by: jerrygarciuh | last post by:
Hi all, I was just wondering what popular opinion is on PHP giving this warning: Warning: Invalid argument supplied for foreach() in /home/boogerpic/public_html/my.php on line 6 when...
29
by: junky_fellow | last post by:
Consider the following piece of code: struct junk { int i_val; int i_val1; char c_val; }; int main(void) {
2
by: Norman Chong | last post by:
Hi, I want to get my MSXML version from a vb.net program. I do it with the following piece of code, but I'm not very happy with that: Dim Version as String = "4.0" oXML =...
3
by: balakrishnan.dinesh | last post by:
hi frnds How to determine the version of the MSXML installed on a computer and How to determine the version of the MSXML used by Internet Explorer through javascript code. Can anyone say me ,...
2
by: BSeab1024SE | last post by:
In MS Visual C++ some code I wrote generated the warning "conversion from 'int' to 'const float', possible loss of data." In the process of trying to determine if I could rewrite the code to...
92
by: Heinrich Pumpernickel | last post by:
what does this warning mean ? #include <stdio.h> int main() { long l = 100; printf("l is %li\n", l * 10L);
3
by: ghjk | last post by:
I want to expire user account in my php application. Below is my code . But i got "mktime() expects parameter 6 to be long, string given in ". Could anyone tell me what is wrong? Please.. ...
11
by: Jeff | last post by:
I turned on errors in php: ini_set('display_errors','1'); And I got a slew of notices and a couple of warnings. The notices are mostly missing indexes from doing things like this: ...
2
nomad
by: nomad | last post by:
I having troubles with this code I'm getting a error code. Please not this is not an assignment its from a book called PHP Bible. This book is loaded with errors. Warning: mysql_fetch_array()...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.