Background
XSL translates an XML document into a stylized web page. The user can add new elements (and attributes) to the XML document through a form displayed using a jQuery dialog. The XML documents will be transformed into PDF files, ASCII text files, third-party formats, and more. Only the editor needs to be web-based.
Considered using XForms, however (1) it seems like a dead technology; and (2) it does not appear integrate with jQuery seamlessly.
Architecture
The architecture currently resembles:
Apache + PHP => Load XML => XSLTProcessor => XHTML + jQuery => Web Browser
The proposed architecture for editing the XML documents resembles:
Web Browser => jQuery => POST edits => Apache + PHP => Save XML
The XML files are under 5,000 bytes each.
Questions
- How would you refresh the page so that edits are POST’ed and transformed immediately, yet still be responsive?
- How would you simplify the architecture?
Thank you!
Ideas
Looked at converting the XML to JSON, then JSON back to XML (using Pear’s XML_Serializer), however the XML in is not the same as the XML out.
You are right that XForms is essentially dead, but it’s not dead because anything better has come along but rather because the web community has utterly rejected XML. jQuery (and pretty much any major JavaScript framework or library) has no support for XML.
Since you have data model and workflow that is so firmly rooted in XML I think you should still consider using XForms. It would allow you to remove all the transformation steps and use XML from end-to-end. If you can ignore IE6-8 you can have XHTML on the browser as well.
You might also consider a browser XML editor like Xopus.