jquery-based xml editor that uses xml Schemas [clo

2019-06-26 03:26发布

问题:

I'm in need of a web-based xml editor that uses xml schema documents to control the addition of elements and attributes. For example, providing drop-downs for sub-elements when the allowed sub-elements are listed in the schema document. And if an element type is "date," providing a date picker.

In addition, it needs to be extensible, so I can create my own element types. For example, an "HTML" type I can define to bring up an instance of CKEditor for editing.

I've actually written one of these in the past, but not with jquery. I'm about to start over, but it seems like something like this may already exist.

If not a full-fledged tool, then any useful libraries I can leverage would be appreciated as well.

Thanks very much, and I hope this question isn't too vague or off-topic.

Thanks! Don Undeen

回答1:

This topic seems to be unsolved since at least a decade. I'll provide an overview on available solutions. Ranked from the most promising to nice-to-have-heard-about.

  • xsd-forms generates a jQuery-based UI based on an XML Schema. Public beta released is scheduled for June 2013.
  • codemirror seems to be a rather good choice. It has XML autocomplete. However, this autocomplete has to be configured manually.

Concepts of XML editors based on XSD without current implementation is described at two sistes in the net:

  • http://www.xml.com/pub/a/2003/04/30/editing.html
  • http://en.wikibooks.org/wiki/XRX/XForms_Generator
  • Generating XForms from an XML Schema

A rather old overview is provided at: http://wadoku.de/wiki/display/DEV/XSD2Form

Some rudimentary implementations are available at:

  • http://code.google.com/p/xrx/source/browse/#svn/trunk/14-xml-schema-to-xforms
  • http://nunojob.wordpress.com/2008/01/05/creating-a-user-interface-for-xml-schema-using-xforms/
  • http://wsdl2xforms.svn.sourceforge.net/viewvc/wsdl2xforms/wsdl2xforms/trunk/src/schema2xforms.xsl?view=log

As far as I remember, the STP Policy Editor also generates some kind of user input from XML Schema. Possibly, this code can be re-used? http://wiki.eclipse.org/Policy_Framework_in_STP

Plain XML editors in the browser:

  • The jquery.xmleditor might be what you are looking for. They offer a graphical UI for editing XML. For the text-based XML editor, they rely on the Cloud9 editor. Be aware that Cloud9 is GPL licensed.
  • LiveXMLEdit is more an explorer-like editor, but maybe it helps, too
  • AXEL is a library for creating XML authoring applications based on document templates.


回答2:

We sell SDL Xopus, a browser based XML editor that does exactly what you need, except the handling of unstructured HTML in the XML. But Xopus handles mixed content very well, so there is no need for that.

For more information see: http://xopus.com/demos/