You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by lg...@apache.org on 2005/02/24 15:56:15 UTC
svn commit: r155189 - in
cocoon/trunk/src/blocks/template/java/org/apache/cocoon/template/jxtg:
instruction/StartDefine.java script/Parser.java
script/event/StartInstruction.java
Author: lgawron
Date: Thu Feb 24 06:56:13 2005
New Revision: 155189
URL: http://svn.apache.org/viewcvs?view=rev&rev=155189
Log:
every instruction is being notified of end of parsing. No more Parser dependency on StartDefine.
We can introduce configurable tag set now.
Modified:
cocoon/trunk/src/blocks/template/java/org/apache/cocoon/template/jxtg/instruction/StartDefine.java
cocoon/trunk/src/blocks/template/java/org/apache/cocoon/template/jxtg/script/Parser.java
cocoon/trunk/src/blocks/template/java/org/apache/cocoon/template/jxtg/script/event/StartInstruction.java
Modified: cocoon/trunk/src/blocks/template/java/org/apache/cocoon/template/jxtg/instruction/StartDefine.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/blocks/template/java/org/apache/cocoon/template/jxtg/instruction/StartDefine.java?view=diff&r1=155188&r2=155189
==============================================================================
--- cocoon/trunk/src/blocks/template/java/org/apache/cocoon/template/jxtg/instruction/StartDefine.java (original)
+++ cocoon/trunk/src/blocks/template/java/org/apache/cocoon/template/jxtg/instruction/StartDefine.java Thu Feb 24 06:56:13 2005
@@ -69,7 +69,7 @@
return getEndInstruction().getNext();
}
- public void finish() throws SAXException {
+ public void endNotify() throws SAXException {
Event e = next;
boolean params = true;
while (e != this.getEndInstruction()) {
Modified: cocoon/trunk/src/blocks/template/java/org/apache/cocoon/template/jxtg/script/Parser.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/blocks/template/java/org/apache/cocoon/template/jxtg/script/Parser.java?view=diff&r1=155188&r2=155189
==============================================================================
--- cocoon/trunk/src/blocks/template/java/org/apache/cocoon/template/jxtg/script/Parser.java (original)
+++ cocoon/trunk/src/blocks/template/java/org/apache/cocoon/template/jxtg/script/Parser.java Thu Feb 24 06:56:13 2005
@@ -127,15 +127,13 @@
EndInstruction endInstruction = new EndInstruction(locator,
startInstruction);
newEvent = endInstruction;
+ addEvent(newEvent);
+ startInstruction.endNotify();
} else {
StartElement startElement = (StartElement) start;
newEvent = new EndElement(locator, startElement);
startElement.setEndElement((EndElement) newEvent);
- }
- addEvent(newEvent);
- if (start instanceof StartDefine) {
- StartDefine startDefine = (StartDefine) start;
- startDefine.finish();
+ addEvent(newEvent);
}
}
Modified: cocoon/trunk/src/blocks/template/java/org/apache/cocoon/template/jxtg/script/event/StartInstruction.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/blocks/template/java/org/apache/cocoon/template/jxtg/script/event/StartInstruction.java?view=diff&r1=155188&r2=155189
==============================================================================
--- cocoon/trunk/src/blocks/template/java/org/apache/cocoon/template/jxtg/script/event/StartInstruction.java (original)
+++ cocoon/trunk/src/blocks/template/java/org/apache/cocoon/template/jxtg/script/event/StartInstruction.java Thu Feb 24 06:56:13 2005
@@ -16,6 +16,7 @@
package org.apache.cocoon.template.jxtg.script.event;
import org.xml.sax.Locator;
+import org.xml.sax.SAXException;
public abstract class StartInstruction extends Event {
public StartInstruction(Locator locator) {
@@ -37,5 +38,9 @@
public void setEndInstruction(EndInstruction endInstruction) {
this.endInstruction = endInstruction;
+ }
+
+ public void endNotify() throws SAXException {
+ return;
}
}
Re: svn commit: r155189 - in cocoon/trunk/src/blocks/template/java/org/apache/cocoon/template/jxtg:
instruction/StartDefine.java script/Parser.java script/event/StartInstruction.java
Posted by Vadim Gritsenko <va...@reverycodes.com>.
Leszek Gawron wrote:
> Daniel Fagerstrom wrote:
>
>> Leszek Gawron wrote:
>>
>>> I cannot find the relevant thread: do we want our instructions'
>>> configuration to reside in sitemap or be set up in cocoon.xconf?
>>
>>
>> Neither ;) Vadim suggested somewhere that we should do it as in the
>> treeprocessor, i.e. there is a configuration file
>> o.a.c.components.treeprocessor.sitemap-language.xml that is included
>> with the resource protocol in
>> o.a.c.components.treeprocessor.DefautlTreeBuilder and
>> o.a.c.components.treeprocessor.TreeProcessor. IIRC Stefano and I and
>> maybe some others found that a good idea.
>
> Tha's a good idea. Could someone tell me how do I reach that
> configuration from generator?
See TreeProcessor.configure():
String XCONF_URL = "resource://.../treeprocessor-builtins.xml";
String xconfURL = config.getAttribute("config", XCONF_URL);
Source source = this.resolver.resolveURI(xconfURL);
Vadim
Re: svn commit: r155189 - in cocoon/trunk/src/blocks/template/java/org/apache/cocoon/template/jxtg:
instruction/StartDefine.java script/Parser.java script/event/StartInstruction.java
Posted by Leszek Gawron <lg...@apache.org>.
Daniel Fagerstrom wrote:
> Leszek Gawron wrote:
>
>> lgawron@apache.org wrote:
>>
>>> Author: lgawron
>>> Date: Thu Feb 24 06:56:13 2005
>>> New Revision: 155189
>>>
>>> URL: http://svn.apache.org/viewcvs?view=rev&rev=155189
>>> Log:
>>> every instruction is being notified of end of parsing. No more Parser
>>> dependency on StartDefine. We can introduce configurable tag set now.
>>
>>
>> I cannot find the relevant thread: do we want our instructions'
>> configuration to reside in sitemap or be set up in cocoon.xconf?
>
>
> Neither ;) Vadim suggested somewhere that we should do it as in the
> treeprocessor, i.e. there is a configuration file
> o.a.c.components.treeprocessor.sitemap-language.xml that is included
> with the resource protocol in
> o.a.c.components.treeprocessor.DefautlTreeBuilder and
> o.a.c.components.treeprocessor.TreeProcessor. IIRC Stefano and I and
> maybe some others found that a good idea.
Tha's a good idea. Could someone tell me how do I reach that
configuration from generator?
> It makes it easy enough to modify things while it at the same time
> indicates that JXTG has a predefined set of instructions. Furthermore I
> don't think we should consider the internal interfaces in Template
> stable until we have implemented at least one more language (the
> attribute template language) in it. Before that it can contain to much
> constructions that ties it to ideosyncrasis in JXTG whithout us knowing it.
Agreed.
--
Leszek Gawron MobileBox
lgawron@apache.org http://www.mobilebox.pl
Re: svn commit: r155189 - in cocoon/trunk/src/blocks/template/java/org/apache/cocoon/template/jxtg:
instruction/StartDefine.java script/Parser.java script/event/StartInstruction.java
Posted by Daniel Fagerstrom <da...@nada.kth.se>.
Leszek Gawron wrote:
> lgawron@apache.org wrote:
>
>> Author: lgawron
>> Date: Thu Feb 24 06:56:13 2005
>> New Revision: 155189
>>
>> URL: http://svn.apache.org/viewcvs?view=rev&rev=155189
>> Log:
>> every instruction is being notified of end of parsing. No more Parser
>> dependency on StartDefine. We can introduce configurable tag set now.
>
> I cannot find the relevant thread: do we want our instructions'
> configuration to reside in sitemap or be set up in cocoon.xconf?
Neither ;) Vadim suggested somewhere that we should do it as in the
treeprocessor, i.e. there is a configuration file
o.a.c.components.treeprocessor.sitemap-language.xml that is included
with the resource protocol in
o.a.c.components.treeprocessor.DefautlTreeBuilder and
o.a.c.components.treeprocessor.TreeProcessor. IIRC Stefano and I and
maybe some others found that a good idea.
It makes it easy enough to modify things while it at the same time
indicates that JXTG has a predefined set of instructions. Furthermore I
don't think we should consider the internal interfaces in Template
stable until we have implemented at least one more language (the
attribute template language) in it. Before that it can contain to much
constructions that ties it to ideosyncrasis in JXTG whithout us knowing it.
/Daniel
Re: svn commit: r155189 - in cocoon/trunk/src/blocks/template/java/org/apache/cocoon/template/jxtg:
instruction/StartDefine.java script/Parser.java script/event/StartInstruction.java
Posted by Leszek Gawron <lg...@apache.org>.
lgawron@apache.org wrote:
> Author: lgawron
> Date: Thu Feb 24 06:56:13 2005
> New Revision: 155189
>
> URL: http://svn.apache.org/viewcvs?view=rev&rev=155189
> Log:
> every instruction is being notified of end of parsing. No more Parser dependency on StartDefine.
> We can introduce configurable tag set now.
I cannot find the relevant thread: do we want our instructions'
configuration to reside in sitemap or be set up in cocoon.xconf?
--
Leszek Gawron MobileBox
lgawron@apache.org http://www.mobilebox.pl