escaping double quote

vkrejcirik vkrejcirik at gmail.com
Mon Mar 9 02:07:14 PDT 2009


I try to escape with backslash and i have the same error.

var text = currentNode.In.Content.replace(/</g, "&lt;").replace(/>/g, 
"&gt;").replace(/\"/g,"&quot;");


  syntax error (/apps/servicemix/exchange/html.esp#57) (500)

The requested URL 
/content/servicemix/message_flows/2009030910AM/ID_192.168.36.12-11fea793e58-10_0/ID_192.168.36.12-11fea793e58-10_0.html 
resulted in an error in /apps/servicemix/exchange/html.esp.


      Exception:

org.mozilla.javascript.EvaluatorException: syntax error (/apps/servicemix/exchange/html.esp#57)
	at org.mozilla.javascript.DefaultErrorReporter.runtimeError(DefaultErrorReporter.java:109)
	at org.mozilla.javascript.DefaultErrorReporter.error(DefaultErrorReporter.java:96)
	at org.mozilla.javascript.Parser.addError(Parser.java:140)
	at org.mozilla.javascript.Parser.reportError(Parser.java:154)
	at org.mozilla.javascript.Parser.primaryExpr(Parser.java:2121)
	at org.mozilla.javascript.Parser.memberExpr(Parser.java:1729)
	at org.mozilla.javascript.Parser.unaryExpr(Parser.java:1590)
	at org.mozilla.javascript.Parser.mulExpr(Parser.java:1519)
	at org.mozilla.javascript.Parser.addExpr(Parser.java:1500)
	at org.mozilla.javascript.Parser.shiftExpr(Parser.java:1480)
	at org.mozilla.javascript.Parser.relExpr(Parser.java:1454)
	at org.mozilla.javascript.Parser.eqExpr(Parser.java:1410)
	at org.mozilla.javascript.Parser.bitAndExpr(Parser.java:1399)
	at org.mozilla.javascript.Parser.bitXorExpr(Parser.java:1388)
	at org.mozilla.javascript.Parser.bitOrExpr(Parser.java:1377)
	at org.mozilla.javascript.Parser.andExpr(Parser.java:1365)
	at org.mozilla.javascript.Parser.orExpr(Parser.java:1353)
	at org.mozilla.javascript.Parser.condExpr(Parser.java:1336)
	at org.mozilla.javascript.Parser.assignExpr(Parser.java:1321)
	at org.mozilla.javascript.Parser.expr(Parser.java:1308)
	at org.mozilla.javascript.Parser.statementHelper(Parser.java:1205)
	at org.mozilla.javascript.Parser.statement(Parser.java:655)
	at org.mozilla.javascript.Parser.statements(Parser.java:603)
	at org.mozilla.javascript.Parser.statementHelper(Parser.java:1107)
	at org.mozilla.javascript.Parser.statement(Parser.java:655)
	at org.mozilla.javascript.Parser.statementHelper(Parser.java:701)
	at org.mozilla.javascript.Parser.statement(Parser.java:655)
	at org.mozilla.javascript.Parser.parse(Parser.java:377)
	at org.mozilla.javascript.Parser.parse(Parser.java:336)
	at org.mozilla.javascript.Context.compileImpl(Context.java:2322)
	at org.mozilla.javascript.Context.compileReader(Context.java:1310)
	at org.mozilla.javascript.Context.compileReader(Context.java:1282)
	at org.mozilla.javascript.Context.evaluateReader(Context.java:1224)
	at org.apache.sling.scripting.javascript.RhinoJavaScriptEngine.eval(RhinoJavaScriptEngine.java:97)
	at org.apache.sling.scripting.core.impl.DefaultSlingScript.call(DefaultSlingScript.java:135)
	at org.apache.sling.scripting.core.impl.DefaultSlingScript.eval(DefaultSlingScript.java:106)
	at org.apache.sling.scripting.core.impl.DefaultSlingScript.service(DefaultSlingScript.java:219)
	at org.apache.sling.engine.impl.request.RequestData.service(RequestData.java:462)
	at org.apache.sling.engine.impl.SlingMainServlet.processRequest(SlingMainServlet.java:419)
	at org.apache.sling.engine.impl.filter.RequestSlingFilterChain.render(RequestSlingFilterChain.java:48)
	at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:54)
	at org.apache.sling.engine.impl.debug.RequestProgressTrackerLogFilter.doFilter(RequestProgressTrackerLogFilter.java:59)
	at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:52)
	at org.apache.sling.engine.impl.SlingMainServlet.service(SlingMainServlet.java:273)
	at org.apache.sling.engine.impl.SlingMainServlet.service(SlingMainServlet.java:171)
	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:362)
	at org.ops4j.pax.web.service.internal.HttpServiceServletHandler.handle(HttpServiceServletHandler.java:51)
	at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:722)
	at org.ops4j.pax.web.service.internal.HttpServiceContext.handle(HttpServiceContext.java:87)
	at org.ops4j.pax.web.service.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:63)
	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
	at org.mortbay.jetty.Server.handle(Server.java:324)
	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
	at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:828)
	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:514)
	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
	at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)


/**************************************/
Best regards / S pozdravem
Vladislav Krejčiřík

http://www.vkrejcirik.info



Zachary Carter napsal(a):
> Escape it with a backslash:
>
> /\"/g
>
> --
> Zach Carter
> http://zach.carter.name
>
>
>
> 2009/3/8 vkrejcirik <vkrejcirik at gmail.com>:
>   
>> I need to escape double quote in function replace.
>> My code:
>>
>> var text = currentNode.In.Content.replace(/</g, "&lt;").replace(/>/g,
>> "&gt;").replace(/"/g,"&quot;");
>>
>> but problem is in /"/g.
>> Do you have any idea?
>> thanks
>>
>> --
>> /**************************************/
>> Best regards / S pozdravem
>> Vladislav Krejčiřík
>>
>> http://www.vkrejcirik.info
>>
>> _______________________________________________
>> Es-discuss mailing list
>> Es-discuss at mozilla.org
>> https://mail.mozilla.org/listinfo/es-discuss
>>
>>     


More information about the Es-discuss mailing list