Re: xml to array

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I've got my money on the XML spec REQUIRING an alphabetic start to
tagnames, and subsequent characters can be alphanumeric...

In other words, it doesn't work because <0> is not a valid XML tag.

You'll have to find and read the XML spec to be 100% certain.
http://info.com/XML+specification

If I'm wrong, you get to file a bug report:
http://bugs.php.net
:-)

On Fri, February 3, 2006 3:07 pm, Brian V Bonini wrote:
> <AD_DATA>
> <SESSION_INFO>
> <FIRST_NAME>Joe</FIRST_NAME>
> <LAST_NAME>Shmoe</LAST_NAME>
> <TEST_KEY>
> <foo>foo</foo>
> <bar>bar</bar>
> </TEST_KEY>
> <OPTIONS>
> <0>DNR</0>
> <1>OPT</1>
> <2>FOO</2>
> <3>BAR</3>
> <4>CWS</4>
> <5>AVS</5>
> </OPTIONS>
> <HEIGHT>72</HEIGHT>
> <WEIGHT>96Kg</WEIGHT>
> </SESSION_INFO>
> <PAA>
> <logCount>0</logCount>
>
> etc...
>
> $xml_data = $xml;
> $parser = xml_parser_create();
> xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0);
> xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 0);
> xml_parse_into_struct($parser, $xml_data, &$values, &$tags);
> xml_parser_free($parser);
>
> each time I print out the tags or vals it stops at the options node:
>
> [13] => Array
>                         (
>                             [tag] => OPTIONS
>                             [type] => open
>                             [level] => 3
>                             [value] =>
>
>                         )
>
> [OPTIONS] => Array
>                         (
>                             [0] => 13
>                         )
>
> Something to do with the numerical node names..?? If I change them to
> non-numeric vals all is good... What Am I missing??
>
> -B
>
>
> --
>
> s/:-[(/]/:-)/g
>
>
> Brian        GnuPG -> KeyID: 0x04A4F0DC | Key Server: pgp.mit.edu
> ======================================================================
> gpg --keyserver pgp.mit.edu --recv-keys 04A4F0DC
> Key Info: http://gfx-design.com/keys
> Linux Registered User #339825 at http://counter.li.org
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux