Hey,
I've been playing w/ DOM functions (not very documented, but cool :)
and had the following:

[categories.xml]

<?xml version="1.0"?>
<catalog>
        <category id="db" name="Databases">
                <topic>
                  <name>MySQL</name>
                  <description>MySQL Manual</description>
                </topic>

                <topic>
                  <name>PostgreSQL</name>
                  <description>PostgreSQL Manuals</description>
                </topic>

        </category>
 </catalog>

[xmltest.php]
<?php
header ('Content-Type: text/plain');

$doc  = new DomDocument();
$node = new DomNode();

$doc  = xmldocfile ('categories.xml');
$root = $doc->root();
$cats = $root->children();

$node = $cats[0];

print_r ($node->name);


It outputs "text" and I would expect "Databases".

running xmllint gives:

[teo@teo xml]$ xmllint --debug categories.xml 
DOCUMENT
version=1.0
URL=categories.xml
standalone=true
  ELEMENT catalog
    TEXT
      content=
    ELEMENT category
      ATTRIBUTE id
        TEXT
          content=db
      ATTRIBUTE name
        TEXT
          content=Databases
      TEXT
[...]


Any idea what's wrong?

TIA


-- teodor

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to