Mapping XML to Object

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
linchatter
Forum Newbie
Posts: 5
Joined: Fri Oct 08, 2010 8:17 am

Mapping XML to Object

Post 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
User avatar
manohoo
Forum Contributor
Posts: 201
Joined: Wed Dec 23, 2009 12:28 pm

Re: Mapping XML to Object

Post by manohoo »

$object = simplexml_load_file($filename)
linchatter
Forum Newbie
Posts: 5
Joined: Fri Oct 08, 2010 8:17 am

Re: Mapping XML to Object

Post 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.
Post Reply