Php5/xslt

windows

Guest
Hi there,

We have a variety of different stories stored in NITF -- it's an XML format used for the News Industry. I've managed to have XSLT translate it into HTML perfectly -- there are a few glitches, but nothing that I can't handle.

In addition to the story we have stored, however, I would like users of our content management system to be able to drop a "widget" into the content. Basically, a widget is some HTML that's built or generated and stored separately. Widgets may be a poll, photo gallery... whatever. I'm not entirely sure how I plan on having the widgets built/stored, though I have a basic idea of the structure.

My question is: I would like editors to be able to enter in the widget ID, paragraph number and their alignment preference (left, right or center). PHP would then use my widget class to create a new widget object, get some information, and return some HTML that's then placed before the <p> tag on the paragraph the editor selected.

Does anyone have any ideas on how to do this? I'm not too familiar with XSLT, and while I know I can execute a PHP function from XSLT -- I'm not sure if I want to have the widget ids, etc. stored into the articles.

I was thinking of doing something along the lines of taking the return from the XSLT parser and finding the paragraph using XPath, but I'm not sure if that will do exactly what I need it to. Since every module will be different, I don't think it would be possible have a DOM script add/remove nodes.

Any help would be greatly appreciated.
 
Back
Top