tags:

views:

35

answers:

2

I have a XML file and a a bunch of XSD files with schemas. How do I parse the XML file using the correct XSD file and schema in PHP?

A: 

You can use the DOM or XmlReader extensions

to validate documents against a schema.

Gordon
Thanks. But i would like to parse the XML file (get the values), not validate it
jonasl
@jonas Could you update your question and provide an example please? I'm not sure I understand what you are trying to do.
Gordon
+1  A: 

Check this tool - http://github.com/moyarada/XSD-to-PHP. It sounds exactly what you're asking. You can marshal/unmarshal XML usind generated from XSD PHP classes.

Mike Bevz