3

I'm trying to write a script in PHP5 that will:

  1. read in an XSD
  2. let the user give an element/tag name which will serve as the context
  3. output a list of elements allowed within that element/tagname based on the XSD

So far I'm only able to see solutions for using XSDs to validate XML files. Anyone done something like this before?

1 Answer 1

0

Check this tool http://github.com/moyarada/XSD-to-PHP It generates PHP classes from XSd schema, and allows XML marshalling/unmarshalling. After you generate PHP models, your IDE will show you which elements/attributes particular item has. See more examples in the test suite /test/Php2XmlTest.php

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.