C
cmsaunders
I am using simpleXML in PHP with an XML file that looks something
like:
<people>
<person>
<personID>001</personID>
<forename>Jo</forename>
<surname>Bloggs</surname>
</person>
</people>
I understand that to select the above person, I use:
/people/person[personID='001']
What I want to do is, "give me the names of all elements for the
person with personID 001". This would then return, 'forename and
'surname'. It may be assumed that I do not know that 'forename' and
'surname' exist and there may be other things in there such as
'eyeColour'.
Due to the PHP version being run, I can not use simpleXML's getName()
function. Additionally, XSLT is not an alternative.
Any ideas?
Regards.
like:
<people>
<person>
<personID>001</personID>
<forename>Jo</forename>
<surname>Bloggs</surname>
</person>
</people>
I understand that to select the above person, I use:
/people/person[personID='001']
What I want to do is, "give me the names of all elements for the
person with personID 001". This would then return, 'forename and
'surname'. It may be assumed that I do not know that 'forename' and
'surname' exist and there may be other things in there such as
'eyeColour'.
Due to the PHP version being run, I can not use simpleXML's getName()
function. Additionally, XSLT is not an alternative.
Any ideas?
Regards.