More XML Woes

by Castwide on 5-4-2008 • Tags: pagemill, php, xml10 comments

"XML is like violence. If it doesn't solve your problem, you're not using enough of it." I don't know who said it first (although I've found plenty of people who thought it beared repeating), but I'd sure like to buy him a beer.

I think I've finally found a viable standard for XML processing in the PHP Pagemill, and ultimately in the Phrameworks kernel, after struggling with it for the past two days. The solution is essentially as follows:

  • Any XML document can be a template. If the Pagemill is configured to use a namespace for tags (it uses pm: by default), the namespace should be declared in the root element (e.g., xmlns:pm="http://castwide.com/pagemill").
  • A template can also start with the pm:template element, in which case the contents of the root will be returned after processing. This allows for use of document fragments to be included in other documents, and also for output that is not XML, such as comma-separated values.
  • If a document fails to parse using the DOM, the Pagemill will attempt to repair it by wrapping it inside a pm:template element.

I hope to have a new version of the Pagemill that follows the above process later this week. If I can't get it to work... I guess I'll throw more XML at it.

Comments

generic internet pharmacy renova ultram zyrtec =]] viagra 576
life insurance 84420 home insurance djv
american life insurance company 7054 life insurance rates 70197
car insurance quotes =OOO auto insurance rates =-OOO
cheap auto insurance %[[ temporary health insurance >:-]
ultram wwa cialis viagra 880788
car insurance quotes 9528 new jersey car insurance :-O
short term health insurance gcfxn lifeinsurance idkl
levitra 478 tramadol 536
uiwanh http://scheapcialis.com/ cialis FyzDTo where to buy cialis =-] [url=http://vzikviagra.com/]kamagra viagra cialis apcalis[/url] 5751

Add Comment

More Articles