Re: Adressing XML Objects

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

 



On Thu, Jan 8, 2009 at 4:02 PM, Merlin Morgenstern <merlin_x@xxxxxxxxxxx>wrote:

> Hello nathan,
>
> I am unsing simplexml as it looks really simple :-) However, I could still
> not figure out how to adress data inside tags with attributes. For example:
>
> <anhang location="INTERN" gruppe="TITELBILD">
>        <data>bla blub</data>
>
> $xml->anhang[intern][titelbild]->data will not work.


again, ill need some clarification.  are you trying to get the data node
directly, OR, are you trying to get the contents of all nodes which are
descendants of anhang nodes, w/ attributes location and gruppe, having
values INTERN and TITLEBILD respectively?

these are two different the things, the former being, well simple

$xml->anhang->data

the latter i would do via xpath, which SimpleXML supports as well.

-nathan

[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