PDA

View Full Version : XPath - getting tags



spasticus
27 Oct 2006, 07:24 PM
hey ppl (im in a good mood for a change),

after a previous attempt at making a news script with php and xml i decided to learn php and xml first (good idea huh?).

anyway - using xpath to get certain data in an xml file you use:

print $title->textContent . "\n"; (or similar)

to display the content of each tag.

is there a way to display the name of the tags as well - like (and i know this doesn't work):

print $title->valueTag . "\n"; or textTag or something

any help... Thanks!