Page 1 of 1

Mapping XML to Object

Posted: Fri Sep 02, 2011 3:47 pm
by linchatter
Does anyone know of a tool, script some of that nature that will map a multi-level XML file to a custom object? Using SimpleXML I can get a StdObject, but need to map it to my object.

Visual Studio has a great tool for this called XSD which makes it all seamless. Need to do this with PHP. Any thoughts?

Thanks in advance

Re: Mapping XML to Object

Posted: Mon Sep 05, 2011 12:55 am
by manohoo
$object = simplexml_load_file($filename)

Re: Mapping XML to Object

Posted: Mon Sep 05, 2011 9:55 pm
by linchatter
That is not what I want, I do not want to create a stdObject. I want to map to my cust object. I want to take a known XML file and map it to an a predifined object. Has to be capable of handling multi-level xml. I am in the process of writing one now, still curious if anything is out there.