Re: [Xsltforms-support] schema designer and xforms generator
Brought to you by:
alain-couthures
From: Philip F. <Phi...@ma...> - 2011-11-16 14:46:35
|
Hello Stephen, Although I'm in no position to provide any code to your project I am willing to help with previous experience and ideas as I have done work with transforming XSD into XHTML+XForms (using XSLT) before. One of the biggest issues to start with was the structure of the schema as this will affect how you go about generating the model and the controls. You have a head start in that your editor may well impose a specific design pattern but if you are going to import other schemas then you'll need to consider how to transform third-party schemas to meet your design pattern. It is possible to derive XForm data bindings from the document structure defined by the schema but then that may only hold for a subset of all possible instance structures. Certain classes of constraint can also be derived like enumerations and value restrictions. Use of XSD 1.1/Schematron assertions are also useful. Inserting new nodes into an instance relies upon fragment templates that are pre-populated with required attributes and child elements. These too can be derived from the schema and placed into a 'template' instance in the model. Depending on how big and complex your schema is will decide how big your template instance is. This could get messy! One other aspect to consider is the generation of submission elements. Where will the information for that come from? You do not want to embed that in the schema as that is application specific. It actually makes more sense to start with a service description that references a schema - that then binds the schema to the service and not the other way around. If you're interested in a service description (good RESTful practice IMHO) then I would suggest you look at the Web Application Description Language (WADL) as a possible candidate. A properly marked-up WADL description provides the necessary info to build your model's submission elements. There is a lot of knitting required to do this but it is really good fun and I wish you well. Please e-mail me with any questions and I will do my best to help out. Oh, and on the subject of knitting things together I also strongly suggest that you use XML Pipeline Processing Language (XProc) to do that as you will be bring together a number of different content source and applying a variety of transforms to it so breaking it down into pipeline steps is very useful. Regards Philip From: Stephen Cameron [mailto:ste...@gm...] Sent: Monday, November 14, 2011 10:53 PM To: xsl...@li... Subject: [Xsltforms-support] schema designer and xforms generator Hello All, I am currently working on a project to create an XML Schema Designer and XForms Generator. The XML Schema Designer will itself be an 'XForm', the theory being that XForms is for building XML and that is what XML Schema is, so it should be possible (kind of a 'RepRap'<http://reprap.org/wiki/Main_Page> way of thinking). The current Schema Designer UI version is online at http://collinta.com.au/schema2forms/designer.xml . This is a work in progress, more of a prototype than a beta. I have the notion of how XForms are to be generated clear in my mind but not much progress made on that side as yet. The main principles in the generation process are: 1. Schematron rules (constraints) are embedded into the XML Schema as xs:annotation/xs:appinfo/xxx tags and are used to add constraints to xf:bind elements 2. Generation of Xforms layout occurs by adding render-as attributes to the schema elements, also as xs:annotation/xs:appinfo/xxx tags. The Designer will, I hope, be simple enough for folk without an understanding of XML Schema or Schematron to use. I intend to put the project on sourceforge in the very near future, but if there is anyone with a desire to contribute (effort or ideas) please say. Apart from wanting to create something useful, this project is in part motivated by the desire to demonstrate the power of XForms and particularly a native client-side implementation (which currently means XSLTForms) for creating effective complex UI's, making use of the XForms MVC 'engine'. I'd be really happy if this was a collabortive effort. For me its just part of some other open-source projects (looking at XRX architectures) that I want to do. If there are any serious offers of help, I'll document the design concepts as the highest priority. All contributions will be acknowledged. Regards Steve Cameron |