On Monday, October 6, 2003, at 01:57  AM, Hussein Shafie wrote:

> Alex Milowski wrote:
>> Suppose, for an experiment, I wanted to develop a "plug-in component" 
>> that could
>> edit MathML content.  Ideally, I'd want the ability to edit inline so 
>> that it would
>> be most natural for users.
>> For example, if I wanted a subscribed variable I'd need to have:
>>    <math xmlns="http://www.w3.org/1998/Math/MathML";>
>>     <msub>
>>     <mi>S</mi>
>>     <mrow><mi>d</mi><mo>+</mo><mn>1</mn></mrow>
>>     </msub>
>>    </math>
>> which would give me the variable S with a subscribe of d+1.
>> Obviously, looking at the above, I'd want this to be formatted as an 
>> S with d+1 as
>> the subscribe because the above markup isn't pretty.  Ignoring the 
>> interface issues
>> for the moment, is this possible?  If I have some java component that 
>> can use AWT+Swing
>> to render an appropriate editing interface, can this be plugged into 
>> the XMLEditor?
>> ...and have that GUI bit modify the document appropriately?
>
> Yes. This is called a custom view.
>
> So custom views are pure views (i.e. they cannot be used to edit the 
> document). Other custom views may register themselves with XXE as 
> element, attribute or even subtree editors.

I'm not sure I follow this statement.  It sounds as if there are two 
classes of
custom views:

    1. "Pure" that cannot edit the document.
    2. "Registered" that can edit an element, attribute , or subtree.

>> I'd want the following:
>>    * Ultimately, I'd need the component to be able to tell the editor 
>> whether it
>>      should be block, inline-block, or inline.
>
> This is specified in the CSS style sheet, for custom views like for 
> ordinary views.

OK... good.  So, being inline or inline-block doesn't affect the 
programming of
the custom view?

>>    * The size of the rendered component would be dependent on the 
>> MathML content
>>      read from the document.  This, the bounding box (CSS box) would 
>> be dependent
>>      on feedback from the GUI component.
>
> This is probably possible. I'm not sure.

I would suspect this has to be the same case as tables.  Basically, 
you'd want to
format your custom markup (e.g. MathML), decide the box size, and 
return that
to the formatter.

>>    * I'd like to be able to take advantage of the character palette 
>> as most
>>      mathematics characters are available through unicode.
>
> No. The character palette can just be used to insert a character 
> before the caret of a XXE document view.

Hmmm... that's too bad as for MathML or other custom language editors, 
you'd want to
be able to insert all kinds of characters--from latin or greek 
characters to the special
math operators in Unicode.

>> How difficult is this to integrate?
>
> Integrating any Java AWT/Swing component in XXE as a custom view is 
> not a difficult task.
>
>
>
>> Are there any examples?
>
> XHTML form elements (input, textarea, etc) are custom views.
>
> The Developer's Guide of XXE V2.5 will contain a section explaining 
> how to write a custom view.

If I wanted to experiment with this, how might I get started?  Is there 
a little snippet
of code from the new documentation that can get me started?

Is there a planned release date for V2.5?


> PS: See http://www.xmlmind.com/xmleditor/features.html#planned
>

I see that MathML support is planned--which is very good.  I have other 
vocabularies
that need specialize editors, so I still need to attempt to write a 
plug-in.  :)

Thanks!

Alex Milowski                FAX: (707) 598-7649                        
  alex at milowski.com

"The excellence of grammar as a guide is proportional to the paucity of 
the
inflexions, i.e. to the degree of analysis effected by the language
considered."

Bertrand Russell in a footnote of Principles of Mathematics



Reply via email to