You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Dylan Walsh <Dy...@Kadius.com> on 2001/01/12 16:30:39 UTC

RE: Big XSP Problem with backslashes or double quotes in attribut e values.

The problem is quotes or backslashes in the source XML, to which the XSP is
being applied, rather than the XSP code.

Either way, XSP should perform the necessary escaping. As it is, it crashes
on perfectly legal XML.

Sure, you could conceivably put escaping backslashes in all your attribute
values, but that is not possible for what we're doing, and also if the same
XML is used for something else other than XSP, you've now got unwanted
backlashes all over the place.


> -----Original Message-----
> From:	Michael Bierenfeld [SMTP:michael.bierenfeld@atmiralis.de]
> Sent:	Friday, January 12, 2001 4:13 PM
> To:	cocoon-users@xml.apache.org
> Subject:	Re: Big XSP Problem with backslashes or double quotes in
> attribute  values.
> 
> Hi !
> 
> Just checked it with :
> 
> <page title="Carrier Mask \&quot; Hello" stylesheet="../.
> 
> This results in a page called "Carrier Mask " Hello". Works fine for me.
> But maybe I am misunderstandig you. Java Result has to have a "\" before
> the """. So this results in a String whatever = new String ("Carrier
> Mask \" Hello "); that is correct.
> 
> Regards
> 
> Michael
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org

Re: Big XSP Problem with backslashes or double quotes in attribute values.

Posted by Michael Bierenfeld <mi...@atmiralis.de>.
Hi,

btw. I think its in src/org/apache/cocoon/processor/xsp/xsp-java.xsl.

  <xsl:template match="@*">

........
	
    ((Element) xspCurrentNode).setAttribute(
      "<xsl:value-of select="$attribute-name"/>",
      "<xsl:value-of select="."/>"
    );
  </xsl:template>


It maybe has to be fixed to automatically insert a "\" before the ".

Regards

Michael

Re: Big XSP Problem with backslashes or double quotes in attribute values.

Posted by Michael Bierenfeld <mi...@atmiralis.de>.
Dylan Walsh wrote:
> 
> The problem is quotes or backslashes in the source XML, to which the XSP is
> being applied, rather than the XSP code.
> Sure, you could conceivably put escaping backslashes in all your attribute
> values, but that is not possible for what we're doing, and also if the same
> XML is used for something else other than XSP, you've now got unwanted
> backlashes all over the place.

Correct ! Now I got you. I would also rate this as a bug. :-) Sometimes
its good to see that not only the germans have problems with their
Umlauts. We never use the " :-)

Regards

Michael