[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Texmacs-dev] DOM and TeXmacs roadmap
From: |
Immanuel Normann |
Subject: |
Re: [Texmacs-dev] DOM and TeXmacs roadmap |
Date: |
Tue, 29 Jul 2003 18:48:52 +0200 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4a) Gecko/20030401 |
David Allouche wrote:
DOM level 1:
Structure navigation: can be implemented quite easily using a
SXML-like approach to the STM (Scheme TeXmacs) document
representation. All STM documents can trivially be considered SXML
documents.
The SXML project has attrackted me since while. Now I am interested
about your experience with SXML in TeXmacs. Is there some experimental
code around where manipulate the STM with some SXSLT for instance?
Document manipulation/content manipulation: can be implemented in
the current framework, the current work on converters and generic
structural operators makes it a active field at the moment. One
important (and currently unsolved) problem is the duality between
the relatively static (but easy to use) STM document manipulation
and the more complex (but more dynamic) manipulation of live data
in editors. I will have a look at the DOM spec to help me in my
quest for enlightenment.
What is your precise notion of "dynamic manipulation of life data"?
DOM level 2:
Range model: TeXmacs has a "marker" facility which allows for
position markers which are robust when the document tree is
modified. So this part of DOM might be partly implemented. The
"range of text rather than subtree of nodes" concept is not
planned to be a core feature but it might be implemented as a high
level library.
How do I get and set those markers in Scheme?
How can I access nodes of the document tree?
Two ways:
Using STM:
(tree->object (the-buffer))
gives you the STM representation of the current buffer text.
(tm-assign '() (object->tree x))
sets the current buffer from the STM data in x.
It is quite fun to manipulate the STM with some Scheme functions and
display it with
(tm-assign '() (object->tree x))
Though I can see a result i do not understand 'tm-assign'. I tried to grep the
definition of it, but I could not find it. What is the use of the first
parameter '()?
I couldn't find the definitions of 'tree->object' and 'object->tree' either :-(
Eventually I come back with my original question: "How can I access nodes of the
document tree?"
Perhaps I didn't understand your answer correctly, but my understanding is that
I have to take the whole tree, manipulate it and send it back as a whole. So
isn't it possible to set a subtree of the current buffer?
Note: in the next monthes, texmacs should be modified to support
HTML form, this will require putting GUI items inside the document.
Also, Joris plans to remove the distinction between document tree
and GUI tree, so the EventListener feature might become a reality
soon.
I am really looking forward to that :-)
--
Immanuel