Author Topic: An XML Editing Form  (Read 6298 times)


  • Community Member
  • Posts: 22
  • Hero Points: 3
An XML Editing Form
« on: July 15, 2006, 09:58:36 am »
I have to edit a number of different XML documents, and their content generally falls into two categories: a bunch of fields (date, title, author, keywords, etc.), and "body" text (mostly just text with modest amounts of markup, such as paragraph elements).

I'm interested in experimenting with using SlickEdit (under Windows) to edit such forms and provide some automation (filling in defaults for fields, offering pick lists for other fields, checking for legal values, etc.). My question is whether or not anybody else does anything like this in SlickEdit and, if so, how they structured it.

I *think* I understand the documentation to say that I can access the full power of the editor from inside an "editor control" in a form, so it seems like a form would be the way to go. That would let me implement fields in natural ways via standard Windows controls, and yet still have a place for editing the bulk of the XML that retains the feature set of a normal SlickEdit edit window.

I guess I would have to pilfer xml.e and get its functionality attached to the editor control. I guess I might also have to supply a DLL for any needed functions I can't find, like Julian date operators.

Is this more or less a reasonable way to proceed, or is there a better way? Any tips, ideas, pointers, etc. appreciated!


  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 990
  • Hero Points: 44
Re: An XML Editing Form
« Reply #1 on: July 18, 2006, 02:16:08 pm »
There are a couple SlickEdit forms that use the editor control within the form. One example is the Regex evaluator window. The source code for the Regex window is in the macro file tbregex.e, and the form layout is defined in sysobjs.e as _tbregex_form. To look at the form in the designer view, go to Macro -> Open Form..., and select _tbregex_form. The code in that form doesn't do a lot of manipulation of the editor control, but it does have examples of loading and saving to and from the editor control.

If you want a DOM interface to the XML document, take a look at the _xmlcfg_xxxx Slick-C functions. We use these methods internally for opening XML-formatted project files (like Visual Studio projects), and other XML serialization tasks. The error parsing regular expressions are also stored in XML format, so there are a lot of examples of using _xmlcfg_xxxx in the macro source error.e