cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gkossakow...@apache.org
Subject svn commit: r557400 - in /cocoon/whiteboard/objectmodel: cocoon-expression-language/cocoon-expression-language-impl/src/main/java/org/apache/cocoon/components/expression/jxpath/ cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/templ...
Date Wed, 18 Jul 2007 21:26:17 GMT
Author: gkossakowski
Date: Wed Jul 18 14:26:16 2007
New Revision: 557400

URL: http://svn.apache.org/viewvc?view=rev&rev=557400
Log:
COCOON-2094: Restore support for namespace declarations.

Modified:
    cocoon/whiteboard/objectmodel/cocoon-expression-language/cocoon-expression-language-impl/src/main/java/org/apache/cocoon/components/expression/jxpath/JXPathExpression.java
    cocoon/whiteboard/objectmodel/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/script/event/EndElement.java
    cocoon/whiteboard/objectmodel/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/script/event/StartElement.java
    cocoon/whiteboard/objectmodel/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/script/event/StartPrefixMapping.java

Modified: cocoon/whiteboard/objectmodel/cocoon-expression-language/cocoon-expression-language-impl/src/main/java/org/apache/cocoon/components/expression/jxpath/JXPathExpression.java
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/objectmodel/cocoon-expression-language/cocoon-expression-language-impl/src/main/java/org/apache/cocoon/components/expression/jxpath/JXPathExpression.java?view=diff&rev=557400&r1=557399&r2=557400
==============================================================================
--- cocoon/whiteboard/objectmodel/cocoon-expression-language/cocoon-expression-language-impl/src/main/java/org/apache/cocoon/components/expression/jxpath/JXPathExpression.java
(original)
+++ cocoon/whiteboard/objectmodel/cocoon-expression-language/cocoon-expression-language-impl/src/main/java/org/apache/cocoon/components/expression/jxpath/JXPathExpression.java
Wed Jul 18 14:26:16 2007
@@ -21,10 +21,11 @@
 import java.util.List;
 
 import org.apache.cocoon.components.expression.Expression;
-import org.apache.cocoon.objectmodel.ObjectModel;
 import org.apache.cocoon.components.expression.ExpressionException;
 import org.apache.cocoon.components.expression.jexl.JSIntrospector;
+import org.apache.cocoon.objectmodel.ObjectModel;
 import org.apache.cocoon.util.jxpath.NamespacesTablePointer;
+import org.apache.cocoon.xml.NamespacesTable;
 import org.apache.commons.collections.ArrayStack;
 import org.apache.commons.jxpath.CompiledExpression;
 import org.apache.commons.jxpath.JXPathContext;
@@ -140,8 +141,10 @@
         JXPathContext jxobjectModel = JXPathContext.newContext(contextBean);
         jxobjectModel.setVariables(new VariableAdapter(objectModel));
         jxobjectModel.setLenient(this.lenient);
-        //FIXME
-        //jxobjectModel.setNamespaceContextPointer(new NamespacesTablePointer(objectModel.getNamespaces()));
+        Object namespaces = objectModel.get(ObjectModel.NAMESPACE);
+        if (namespaces instanceof ArrayStack)
+            namespaces = ((ArrayStack)namespaces).peek();
+        jxobjectModel.setNamespaceContextPointer(new NamespacesTablePointer((NamespacesTable)namespaces));
         return jxobjectModel;
     }
 

Modified: cocoon/whiteboard/objectmodel/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/script/event/EndElement.java
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/objectmodel/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/script/event/EndElement.java?view=diff&rev=557400&r1=557399&r2=557400
==============================================================================
--- cocoon/whiteboard/objectmodel/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/script/event/EndElement.java
(original)
+++ cocoon/whiteboard/objectmodel/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/script/event/EndElement.java
Wed Jul 18 14:26:16 2007
@@ -47,7 +47,9 @@
                 .getLocalName(), startElement.getRaw());
 
         // Send any pending endPrefixMapping events
-        //FIXME: expressionContext.getNamespaces().leaveScope(consumer);
+        namespaces.leaveScope(consumer);
+        objectModel.cleanupLocalContext();
+        
         return getNext();
     }
 }

Modified: cocoon/whiteboard/objectmodel/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/script/event/StartElement.java
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/objectmodel/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/script/event/StartElement.java?view=diff&rev=557400&r1=557399&r2=557400
==============================================================================
--- cocoon/whiteboard/objectmodel/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/script/event/StartElement.java
(original)
+++ cocoon/whiteboard/objectmodel/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/script/event/StartElement.java
Wed Jul 18 14:26:16 2007
@@ -123,7 +123,7 @@
         }
         
         // Send any pending startPrefixMapping events
-        //FIXME: expressionContext.getNamespaces().enterScope(consumer);
+        namespaces.enterScope(consumer);
         consumer.startElement(getNamespaceURI(), getLocalName(), getRaw(),
                 attrs);
         return getNext();

Modified: cocoon/whiteboard/objectmodel/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/script/event/StartPrefixMapping.java
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/objectmodel/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/script/event/StartPrefixMapping.java?view=diff&rev=557400&r1=557399&r2=557400
==============================================================================
--- cocoon/whiteboard/objectmodel/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/script/event/StartPrefixMapping.java
(original)
+++ cocoon/whiteboard/objectmodel/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/script/event/StartPrefixMapping.java
Wed Jul 18 14:26:16 2007
@@ -49,9 +49,10 @@
             ObjectModel objectModel,
             ExecutionContext executionContext, MacroContext macroContext,
             NamespacesTable namespaces, Event startEvent, Event endEvent) throws SAXException
{
-        
-        //FIXME: expressionContext.getNamespaces().addDeclaration(getPrefix(), getUri());
         // the startPrefixMapping event will be sent in StartElement
+        namespaces.addDeclaration(getPrefix(), getUri());
+        objectModel.markLocalContext();
+        objectModel.put(ObjectModel.NAMESPACE, namespaces);
         return getNext();
     }
 }



Mime
View raw message