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;
}
}