John L. Clark wrote: > I was working on developing element templates for my users and I was > struck by how it can be confusing to see a set of empty boxes in a newly > generated XML document or element. I thought that it might be useful to > allow configurations to specify template text for initially created new > elements. > > When a user creates a new document or element, temporary text could be > placed within the elements (which allow textual children) indicating the > type of information that should go in that element; this temporary text > could receive a special CSS instruction so that it could be styled > differently to look temporary (such as perhaps greyed out), and it would > never be saved along with the document (or, alternatively, that could be > at user discretion). It could be implemented with an XXE configuration > element such as: > > <cfg:elementTemplate name="date" selectable="override"> > <date> > <cfg:templateContent> > Date of publication here (in YYYY-MM-DD format) > </cfg:templateContent> > </date> > </cfg:elementTemplate> > > And then when the user creates a new date, it would be populated with > the text "Date of publication here (in YYYY-MM-DD format)" until the > user interacts with the text content (such as beginning to type), in > which case it would disappear. Certainly there are some implementation > issues, but I think this could be useful for making XML documents more > usable and understandable.
Perhaps the problem can be tackled differently, not requiring any new feature of XXE. The template can be annotated with XML comments explaining how to fill it. Two different stylesheets could be used to edit the file showing or not the annotations. If appropriate, a command or external utility can be used to strip off the annotations, once the template has been filled. Or even to strip the annotations of just the already filled elements, and not of the still empty ones. The main difference with the above proposal is that comments are certainly editable. But perhaps this could be avoided by rendering comments as generated content. Hope this helps, -- ------------------------------------------------------------------------ Manuel Collado Machuca | Facultad de Informatica UPM Universidad Politecnica de Madrid | Campus de Montegancedo Dep. LSIIS | Boadilla del Monte Tel.+34-91-336.74.57 Fax.+34-91-336.74.12 | 28660 MADRID - SPAIN ------------------------------------------------------------------------

