Page 1 of 1

XML out of XSD

Posted: Wed Sep 19, 2007 12:08 am
by dude81
Hi,

I would like to know how one can make an xml out of an XSD using PHP

dude

Posted: Wed Sep 19, 2007 12:34 am
by timvw
You will have to realise that "an xsd" is nothing more than a text file, containing xml.. (Since xsd documents are xml documents). Thus, as soon as you return the contents of the file, you will have "an xml" from xsd.. You may want to send the header Content-Type: text/plain to inform the consuming user-agents that they should treat the file as regular text...

Posted: Wed Sep 19, 2007 12:46 am
by dude81
I think you got my question wrong. I've a XSD document and I've a data extracted from database, Now I know I've to sent the data in the form of XML. But before that I should know, how do I look up for the particular element identify the type and send the response as XML. How do we do this through PHP is my question... How do we look up for a particular element in XSD and make it as XML.

Posted: Wed Sep 19, 2007 2:24 am
by dude81
I found out myself this url.... More help similarly is appreciated.

Thanks

Posted: Thu Sep 20, 2007 9:11 am
by dude81
I hope I'm not bouncing this post. The above url has been of very little help to me in my code... :( I was bit excited with that yesterday
What I'm trying to achieve is trying to take the key which would be a database field name which is listed in XSD and then identify whether it is a element or an attribute from the xsd and then add it to DOM Im building.