antonio 2003/12/16 20:15:14
Modified: . status.xml
src/blocks/session-fw/java/org/apache/cocoon/components/language/markup/xsp/java
session-fw.xsl
Log:
Fixing NPE error in xsp-session:getxml
Submitted by: Laurent Trillaud
Reviewed by: Antonio Gallardo
Revision Changes Path
1.213 +5 -1 cocoon-2.1/status.xml
Index: status.xml
===================================================================
RCS file: /home/cvs//cocoon-2.1/status.xml,v
retrieving revision 1.212
retrieving revision 1.213
diff -u -r1.212 -r1.213
--- status.xml 12 Dec 2003 15:15:19 -0000 1.212
+++ status.xml 17 Dec 2003 04:15:14 -0000 1.213
@@ -189,6 +189,10 @@
<changes>
<release version="@version@" date="@date@">
+ <action dev="AG" type="fix" due-to-email="[EMAIL PROTECTED]"
due-to="Laurent Trillaud">
+ Fix NPE error when pointed tag is empty in xsp-session-fw:getxml.
Applying
+ patch from [EMAIL PROTECTED] ([EMAIL PROTECTED]).
+ </action>
<action dev="VG" type="update">
ResourceExistsSelector now works the same way as ResourceExistsAction
does.
It can now detect existence of any Cocoon resource, not only files in
context.
1.3 +11 -4
cocoon-2.1/src/blocks/session-fw/java/org/apache/cocoon/components/language/markup/xsp/java/session-fw.xsl
Index: session-fw.xsl
===================================================================
RCS file:
/home/cvs//cocoon-2.1/src/blocks/session-fw/java/org/apache/cocoon/components/language/markup/xsp/java/session-fw.xsl,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- session-fw.xsl 11 Oct 2003 00:02:55 -0000 1.2
+++ session-fw.xsl 17 Dec 2003 04:15:14 -0000 1.3
@@ -73,8 +73,12 @@
<xsp:include>org.apache.avalon.framework.component.ComponentManager</xsp:include>
<xsp:include>org.apache.cocoon.components.language.markup.xsp.XSPSessionFwHelper</xsp:include>
<xsp:include>org.w3c.dom.DocumentFragment</xsp:include>
+ <xsp:include>org.w3c.dom.Node</xsp:include>
</xsp:structure>
+ <xsp:logic>
+ Node node = null;
+ </xsp:logic>
<xsl:variable name="create">
<xsl:choose>
<xsl:when test="@create-session='yes' or
@create-session='true'">true</xsl:when>
@@ -104,9 +108,12 @@
</xsl:variable>
<xsl:choose>
<xsl:when test="$as='string'">
-
<xsp:expr>((DocumentFragment)(XSPSessionFwHelper.getXML(this.manager,
+ <xsp:logic>
+ node =
((DocumentFragment)(XSPSessionFwHelper.getXML(this.manager,
String.valueOf(<xsl:copy-of select="$context"/>),
- String.valueOf(<xsl:copy-of
select="$path"/>)))).getFirstChild().getNodeValue()</xsp:expr>
+ String.valueOf(<xsl:copy-of
select="$path"/>)))).getFirstChild();
+ </xsp:logic>
+ <xsp:expr>node != null ? node.getNodeValue() : ""</xsp:expr>
</xsl:when>
<xsl:when test="$as='xml'">
<xsp-session-fw:xml>