XML DOM: encoding attribute problems and namespaces
| From: | ZeNDeR-X | Date: | Thu, 13 Sep 2001 12:59:44 +0000 |
| Subject: | XML DOM: encoding attribute problems and namespaces | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-67196@lists.php.net to get a copy of this message | ||
hi ;)
Recently I've been using the DOM module of php and I have
encountered a few problems. I am working on a quite advanced XML application
and I am forced to use the PHP technology.
I need to dynamically create XML documents. There's no problem with that
when i simply use this statement:
$doc = xmldoc('<?xml version="1.0"
encoding="iso-8859-1"?><categories/>');
but when i use this:
$doc = xmldoc('<?xml version="1.0"
encoding="iso-8859-2"?><categories/>');
php doesn't parse my document! it doesn't even give me an error message ;(
does anyone have an idea what to do with it?
also is there a way to declare a document without a root element, but with
the "encoding" attribute set?
it's possible to do it like this:
$doc = new_xmldoc('1.0');
but i can't set the encoding attribute then.
if i try something like this:
$doc = xmldoc('<?xml version="1.0" encoding="iso-8859-1"?>');
i get this after $doc->dumpmem():
<?xml version='<?xml version="1.0"
encoding="iso-8859-1"?>'?>
i'm also wondering about the use of namespaces in PHP DOM.
is it possible? where can i get some infos about it?
sorry if this post repeats some threads, but i'm new to this group ;)
Chris Jarecki
ps: sorry for possible language mistakes ;)