Return-Path: Mailing-List: contact cocoon-users-help@xml.apache.org; run by ezmlm Delivered-To: mailing list cocoon-users@xml.apache.org Received: (qmail 15858 invoked from network); 15 Jan 2001 10:38:20 -0000 Received: from unknown (HELO tssmx1.tss.ie) (195.7.49.66) by h31.sny.collab.net with SMTP; 15 Jan 2001 10:38:20 -0000 Received: by TSSMX1 with Internet Mail Service (5.5.2650.21) id ; Mon, 15 Jan 2001 10:32:44 -0000 Message-ID: <8BD71A154EA6D211873E00105A125CDF4E3FF1@TSSMX1> From: Dylan Walsh To: Robin Green , cocoon-users@xml.apache.org, cocoon-dev@xml.apache.org Subject: RE: Big XSP Problem with backslashes or double quotes in attribut e values. Date: Mon, 15 Jan 2001 10:32:42 -0000 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2650.21) Content-Type: multipart/mixed; boundary="----_=_NextPart_000_01C07EDE.7E284342" X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N ------_=_NextPart_000_01C07EDE.7E284342 Content-Type: text/plain Thanks to Michael Bierenfield who pointed out that the Java files are generated with an XSL transformation: org/apache/cocoon/processor/xsp/xsp-java.xsl. I changed the template for attributes, and put in some code to escape backslashes and quotes in attribute values. The search and replace is based on an example from the XSLT FAQ. I regenerated the Cocoon.jar with the new xsp-java.xsl. I have tested this and it fixes the problem. Here is the corrected version of the file. Please feel free to use this in future versions of Cocoon, if you wish. Note that the version below is for Cocoon 1.7.4, however the changes can be applied to the 1.8 version, and the modified templates have comments with "DW" at the start of them for easy location. <> > -----Original Message----- > From: Robin Green [SMTP:greenrd@hotmail.com] > Sent: Friday, January 12, 2001 9:20 PM > To: cocoon-users@xml.apache.org > Cc: Dylan.Walsh@Kadius.com > Subject: Re: Big XSP Problem with backslashes or double quotes in > attribute va lues. > > Thanks, this is a confirmed bug. You can track progress here: > > http://nagoya.apache.org/bugzilla/show_bug.cgi?id=33 > ------_=_NextPart_000_01C07EDE.7E284342 Content-Type: application/octet-stream; name="xsp-java.xsl" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="xsp-java.xsl" package ; import java.io.*; import java.net.*; import java.util.*; import org.w3c.dom.*; import org.xml.sax.*; import javax.servlet.*; import javax.servlet.http.*; import org.apache.cocoon.parser.*; import org.apache.cocoon.producer.*; import org.apache.cocoon.framework.*; import org.apache.cocoon.processor.xsp.*; import org.apache.cocoon.processor.xsp.library.*; /* User Imports */ import ; public class extends XSPPage { /* User Class Declarations */ public void populateDocument( HttpServletRequest request, HttpServletResponse response, Document document ) throws Exception { // Node stack logic variables Node xspParentNode =3D null; Node xspCurrentNode =3D document; Stack xspNodeStack =3D new Stack(); true false // Make session object readily available HttpSession session =3D request.getSession(); document.appendChild( document.createProcessingInstruction( "", "" ) ); } } xspParentNode =3D xspCurrentNode; xspNodeStack.push(xspParentNode); xspCurrentNode =3D document.createElement(""); xspParentNode.appendChild(xspCurrentNode); ((Element) xspCurrentNode).normalize(); xspCurrentNode =3D (Node) xspNodeStack.pop(); ((Element) xspCurrentNode).setAttribute( "", "" String.valueOf() + "" ); xspCurrentNode.appendChild( xspExpr(, document) ); xspCurrentNode.appendChild( document.createTextNode("") ); document.appendChild( document.createProcessingInstruction( "", "" String.valueOf() + "" ) ); xspCurrentNode.appendChild( document.createTextNode("") ); xspParentNode =3D xspCurrentNode; xspNodeStack.push(xspParentNode); xspCurrentNode =3D document.createElement(""); xspParentNode.appendChild(xspCurrentNode); ((Element) xspCurrentNode).normalize(); xspCurrentNode =3D (Node) xspNodeStack.pop(); xmlns: ((Element) xspCurrentNode).setAttribute( "", "" ); =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 "" Node xspParentNode =3D null; Node xspCurrentNode =3D ; Stack xspNodeStack =3D new Stack(); Document document =3D .getOwnerDocument(); ------_=_NextPart_000_01C07EDE.7E284342--