You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Ulrich Mayring <ul...@denic.de> on 2000/05/11 13:42:17 UTC

XSP Bug(?) with Backslashes

Hello,

I have an XML file that contains some paths as data like this:

<file>C:\some\path\file</file>

The whole thing is displayed via an XSLT stylesheet and it works fine.
Now, if I make the XML file an XSP page by adding <?cocoon-process
type="xsp"?> and the enclosing <xsp:page> tags, then it breaks. I get
this error message:

String not terminated at end of line.
document.createTextNode("C:\some\path\file")

I'm pretty sure this has to do with the fact that Java interprets the
"\" character as an escape character. Looking at the source I find that
the exact same code is generated with both version (XML/XSLT and XSP):

xspCurrentNode.appendChild(
      document.createTextNode("C:\some\path\file")
    );

So I guess the error is probably higher up in the processing chain.

Ulrich

-- 
Ulrich Mayring
DENIC eG, Systementwicklung

Re: XSP Bug(?) with Backslashes

Posted by Ricardo Rocha <ri...@apache.org>.
On Thu, 11 May 2000, Ulrich Mayring wrote:
> I have an XML file that contains some paths as data like this:
> <file>C:\some\path\file</file>
> The whole thing is displayed via an XSLT stylesheet and it works fine.
> Now, if I make the XML file an XSP page by adding <?cocoon-process
> type="xsp"?> and the enclosing <xsp:page> tags, then it breaks. I get
> this error message:
>   String not terminated at end of line.
>   document.createTextNode("C:\some\path\file")
> I'm pretty sure this has to do with the fact that Java interprets the
> "\" character as an escape character. Looking at the source I find that
> the exact same code is generated with both version (XML/XSLT and XSP):
>    xspCurrentNode.appendChild(
>         document.createTextNode("C:\some\path\file")
>     );

Fixed.

Thanks Ulrich!