How can I create a (empty) XML file trough a existing XSD schema? Which PHP (5.3) functions are necessary?
I was also searching on how to "initialize" directly a DOM XML object that corresponds to an existing XSD in PHP. This allows for easily "feeding" this empty XML file with my own data. Found only ONE method that does it, the SDO DAS XML extension of PHP
http://www.php.net/manual/en/sdo-das-xml.examples.php
see example #2. Unfortunately the extension is not by default in PHP 5.3, you have to add it through PECL, which does't work on my Windows PC, so I could not test it.
You would need to write a PHP parser that takes the XSD file and builds, tag by tag, an XML file.
Depending on the complexity of your XSD schema, this could either take a short/medium amount of time - or it could be entirely unfeasible, in terms of "you should probably just make an XML file by hand".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With