You are here:  » Access grand parent element?


Access grand parent element?

Submitted by febian on Sat, 2013-08-10 15:50 in

Hi,

I am new to XML/PHP. While I am able to parse the child elements and the parent element, how do I access the grand parent element?

Say I have a structure like this

GrandParent
GrandParentID
- Parent1_ID
ParentID
- Child1
Child1_ID
- Child2
Child2_ID
- GrandChild1_ID
- Parent2
Parent2_ID
- Child1
Child1_ID

Thanks! I hope the question makes sense.

Submitted by support on Sat, 2013-08-10 16:34

Hello febian,

Yes - that makes sense; Magic Parser was originally designed to process "flat" records - a simple XML structure containing a large number of repeating records at a single level, but I recently tested a modification that provides access to the parent/grandparent elements using a field naming convention similar to how parent directories are referenced in file systems / websites.

I will email this version for you to try now...

Regards,
David
--
MagicParser.com