blasto333 Posted June 28, 2007 Share Posted June 28, 2007 I am currently an information technology student at RIT (Rochester Institute Of technology). I am involved in a very interesting project known as Molly. Molly is an xml abstraction layer on top of php. Basically it has a set of "maml" xml tags that generate php to preform common tasks. These "maml" tags are embedded in existing XHTML documents. Here is a quick example of a tag:(This would be in an XHTML document) <maml:select query="SELECT * FROM test"> <maml:record> Person Name: <maml:field name="person_id" /> </maml:record> </maml:select> We are currently using the SAX for parsing the xml document. We are considering an architecture change. Here are the problems we have with SAX: * The document must be perfect XHTML or it will have parsing errors * Very hard to program using it * Has a hard time with entities such as when between tags. I am not sure how many XML abstraction layer's have been built using PHP, but are there any other methods for competing this task? Any suggestions would be helpful. Quote Link to comment https://forums.phpfreaks.com/topic/57489-creating-xml-language-on-top-of-php/ Share on other sites More sharing options...
Buyocat Posted June 28, 2007 Share Posted June 28, 2007 Well there is DOM available too, but I am not sure why SAX won't work for you. I also found making a SAX parser difficult until I came across this. http://homework.nwsnet.de/products/69 It's very clear and I think you could probably just lift the ideas from it and implement them yourself if you wanted to. The only thing which may cause an error is the namespaces on the tags, but aside from that the query would be passed as attribute data, and the "Person Name" would be character data. I believe that XML ans DOM are the two options available period, so you'd need to find a way to accomodate one. I don't much about using DOM, but I believe it's more complicated to implement and stores the entire document structure in memory. Implementing your own parser is a possibility too, but I think that will most likely turn into a large project. Also it's worth checking out PEAR or even PECL for solutions; those would most likely be of the highest quality. Quote Link to comment https://forums.phpfreaks.com/topic/57489-creating-xml-language-on-top-of-php/#findComment-284508 Share on other sites More sharing options...
blasto333 Posted June 28, 2007 Author Share Posted June 28, 2007 SAX is working for us I was just wondering if there were any alternatives. Thanks for the link to that XMLparser I am going to compare it to what we did. Thanks, Chris Quote Link to comment https://forums.phpfreaks.com/topic/57489-creating-xml-language-on-top-of-php/#findComment-284514 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.