problem with DOMDocument

This is a discussion on problem with DOMDocument within the PHP General forums, part of the PHP Programming Forums category; hi I have trouble while creating an DOMDocument. When I make $test = new DomDocument('1.0'); php tells me a ...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 07-18-2008
Christoph Kappestein
 
Posts: n/a
Default problem with DOMDocument

hi

I have trouble while creating an DOMDocument. When I make $test = new
DomDocument('1.0');
php tells me a warning error like:

Entity: line 1: parser error : Start tag expected, '<' not found ...

Because of unknow reasons the DomDocument constructor expected a tag
like '<test />'.

Ive looked in the manual and see DomDocument::__construct([ string
$version [, string $encoding ]] );

btw when I type $test = new DomDocument('<test />'); then comes no
warning error.

Why can I not create a dom document like $test = new DomDocument('1.0');
without any warning error?

I can suppress the warning with @. When I make var_dump on $test it comes

object(domdocument)#1 (0) {
}

that means the object is created.

I use XAMPP with PHP 5.2.6 on an windows vista machine

thanks for any help

Reply With Quote
  #2 (permalink)  
Old 07-18-2008
Andrew Ballard
 
Posts: n/a
Default Re: [PHP] problem with DOMDocument

On Fri, Jul 18, 2008 at 6:51 AM, Christoph Kappestein
<christoph@kappestein.com> wrote:
> hi
>
> I have trouble while creating an DOMDocument. When I make $test = new
> DomDocument('1.0');
> php tells me a warning error like:
>
> Entity: line 1: parser error : Start tag expected, '&lt;' not found ...
>
> Because of unknow reasons the DomDocument constructor expected a tag like
> '<test />'.
>
> Ive looked in the manual and see DomDocument::__construct([ string $version
> [, string $encoding ]] );
>
> btw when I type $test = new DomDocument('<test />'); then comes no warning
> error.
>
> Why can I not create a dom document like $test = new DomDocument('1.0');
> without any warning error?
>
> I can suppress the warning with @. When I make var_dump on $test it comes
>
> object(domdocument)#1 (0) {
> }
>
> that means the object is created.
>
> I use XAMPP with PHP 5.2.6 on an windows vista machine
>
> thanks for any help
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


I've not used XAMPP, but someone added a comment on the doc page
(http://www.php.net/manual/en/domdocument.construct.php) that might
shed some light on the subject. Is it possible you've got the wrong
library installed?

Andrew
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 01:24 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0