You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Daniel Migowski <Mi...@artis.uni-oldenburg.de> on 2005/04/28 15:24:16 UTC

XSLT-based WYSIWYG XML Editor

Hello xalan developers,

I am exploring the possibilities to write an XSLT-based WYSIWYG XML Editor. This means, I want to edit the HTML-Output of an XSLT-Transformation and change the originating XML Document. I know that have to rewrite some (or many) parts of Xalan, but I am willing to do so :)

First, the concept:

The base concept is to annotate every generated output with the location and templates in the xslt-file, that were responsible for generating each output fragment. In addition, I annotate the output with every matching XPath-Query that was done, to link back to the original document. I will even add the not-matched querys (like unsatisfied xsl:if statements, to find the output positions, that have to be reevaluated, after a part of the original xml document changes. All matched or unmatched annotated XPathQuerys in the output document will have a context supplied, if they are relative. 
Now when i add some text to the result document, i can find out the source location in the xml document, change that, a by scanning the xpath querys in the result document, i can find out which parts of the transformation i have to redo.  
If someone is interested, I would like to provide a larger description document to discuss it.

Second, my estimation of my chances:

After three days of digging through the Xalan Sources (I found a few bugs while doing so, I send the patches later), I found out, that I could provide an enhanced SerializationHandler, that has a back reference to the transformer, or just is a trace listener, to have the input ready for annoting my output document, to refer back to the originating xml document.

Third, my questions:

(I will code to achive those goals, but just need to know, if the current architecture of xalan would support it, before start hacking)

Q1: Is it possible to start transforming just for a small range of the originating document, like just applying a template to a given node in the xml tree, and capturing just this small part of output? I need this when I have to rebuild parts of the document. 
Q2: How do i do only a partial transformation? I think of selection a node from my originating document, and the transform only this part of the xml document. 
Q3: In the sources i found, that the DTM that was build from the XML-Document, is not assumed to change during the transformation. Is it possible to reuse a changed DTM with the same tranformer to redo some part of the transformation, like stated in Q2?
Q4: Can I reuse compliled XPathExpressions, if the underlying DTM changes? (For Speed)
Q5: Dis someone do this before?
Q6: Do you think I am completly mad trying this? :)

Ciao,
Daniel Migowski

Re[2]: XSLT-based WYSIWYG XML Editor

Posted by Daniel Migowski <Mi...@artis.uni-oldenburg.de>.
Hi Lionel,

Thank you for your response.

Am Donnerstag, 28. April 2005 um 16:10:52 meintest Du:
LV> whenever the HTML-output is changed, not only the source
LV> document might change but also the transformation itself. Let say
LV> that your stylesheet generates a <p> element, then in your editor
LV> when the author changes a paragraph (P) into a header (HX) then
LV> the stylesheet itself needs to be changed. 

This is something i wouldn't need to alter. In my view, the user should
only be able to alter the text representation of texts from the xml
directly. Structural changes would be made directly in the xml tree.

I would like to have the user add or remove nodes in the xml, if the
Schema would allow it, and provide him with convenience methods to do so.

Of course, for every part of the xml, in which child text elements 
do not render by the xslt, selection of the underlying xml nodes is not
possible, so a specialised editor (complementary to the xslt), should
provide functionality to alter these parts of the xml in another way,
either by property sheets or by something else.

LV> Anyway I've done some works on this topic in the context of
LV> editing generic multmedia documents. Here some references:

Looks great, i will have a deep look in it later.

LV> "An Incremental XSLT Transformation Processor for XML
LV> Document Manipulation", http://www2002.org/CDROM/refereed/321/
LV> "Authoring transformations by direct manipulation for
LV> adaptable multimedia presentations",
LV> http://portal.acm.org/citation.cfm?id=502206

LV> Enjoy!
LV> Lionel

Thank you and greeting,
Daniel 

Re: XSLT-based WYSIWYG XML Editor

Posted by Lionel Villard <vi...@us.ibm.com>.
Hi Daniel,

> I am exploring the possibilities to write an XSLT-based WYSIWYG XML 
> Editor. This means, I want to edit the HTML-Output of an XSLT-
> Transformation and change the originating XML Document.

whenever the HTML-output is changed, not only the source document might 
change but also the transformation itself. Let say that your stylesheet 
generates a <p> element, then in your editor when the author changes a 
paragraph (P) into a header (HX) then the stylesheet itself needs to be 
changed. 

Anyway I've done some works on this topic in the context of editing 
generic multmedia documents. Here some references:

"An Incremental XSLT Transformation Processor for XML Document 
Manipulation", http://www2002.org/CDROM/refereed/321/
"Authoring transformations by direct manipulation for adaptable multimedia 
presentations", http://portal.acm.org/citation.cfm?id=502206

Enjoy!
Lionel



Daniel Migowski <Mi...@artis.uni-oldenburg.de> wrote on 04/28/2005 
09:24:16 AM:

> Hello xalan developers,
> 
> I am exploring the possibilities to write an XSLT-based WYSIWYG XML 
> Editor. This means, I want to edit the HTML-Output of an XSLT-
> Transformation and change the originating XML Document. I know that 
> have to rewrite some (or many) parts of Xalan, but I am willing to do so 
:)
> 
> First, the concept:
> 
> The base concept is to annotate every generated output with the 
> location and templates in the xslt-file, that were responsible for 
> generating each output fragment. In addition, I annotate the output 
> with every matching XPath-Query that was done, to link back to the 
> original document. I will even add the not-matched querys (like 
> unsatisfied xsl:if statements, to find the output positions, that 
> have to be reevaluated, after a part of the original xml document 
> changes. All matched or unmatched annotated XPathQuerys in the 
> output document will have a context supplied, if they are relative. 
> Now when i add some text to the result document, i can find out the 
> source location in the xml document, change that, a by scanning the 
> xpath querys in the result document, i can find out which parts of 
> the transformation i have to redo. 
> If someone is interested, I would like to provide a larger 
> description document to discuss it.
> 
> Second, my estimation of my chances:
> 
> After three days of digging through the Xalan Sources (I found a few
> bugs while doing so, I send the patches later), I found out, that I 
> could provide an enhanced SerializationHandler, that has a back 
> reference to the transformer, or just is a trace listener, to have 
> the input ready for annoting my output document, to refer back to 
> the originating xml document.
> 
> Third, my questions:
> 
> (I will code to achive those goals, but just need to know, if the 
> current architecture of xalan would support it, before start hacking)
> 
> Q1: Is it possible to start transforming just for a small range of 
> the originating document, like just applying a template to a given 
> node in the xml tree, and capturing just this small part of output? 
> I need this when I have to rebuild parts of the document. 
> Q2: How do i do only a partial transformation? I think of selection 
> a node from my originating document, and the transform only this 
> part of the xml document. 
> Q3: In the sources i found, that the DTM that was build from the 
> XML-Document, is not assumed to change during the transformation. Is
> it possible to reuse a changed DTM with the same tranformer to redo 
> some part of the transformation, like stated in Q2?
> Q4: Can I reuse compliled XPathExpressions, if the underlying DTM 
> changes? (For Speed)
> Q5: Dis someone do this before?
> Q6: Do you think I am completly mad trying this? :)
> 
> Ciao,
> Daniel Migowski