473,396 Members | 2,037 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,396 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 12836

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()...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
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.