XML out of XSD

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
User avatar
dude81
Forum Regular
Posts: 509
Joined: Mon Aug 29, 2005 6:26 am
Location: Pearls City

XML out of XSD

Post by dude81 »

Hi,

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

dude
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post 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...
User avatar
dude81
Forum Regular
Posts: 509
Joined: Mon Aug 29, 2005 6:26 am
Location: Pearls City

Post 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.
User avatar
dude81
Forum Regular
Posts: 509
Joined: Mon Aug 29, 2005 6:26 am
Location: Pearls City

Post by dude81 »

I found out myself this url.... More help similarly is appreciated.

Thanks
User avatar
dude81
Forum Regular
Posts: 509
Joined: Mon Aug 29, 2005 6:26 am
Location: Pearls City

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