XML : Unexpected token ILLEGAL when load xml object?

A seesion from database and marshal to String

  String xml = XMLUtils.marshallToString(list);  sre.getServletRequest().setAttribute("LIST", xml);    

and code JS

  var regObject = '${requestScope.LIST}';    

..... when open in browser. View source i have error Unexpected token ILLEGAL.

      var regObject = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>//Unexpected token ILLEGAL  <items>      <item>          <id>ID</id>          <productName>PrdName</productName>          <productLink>LINK</productLink>          <productImage>IMG</productImage>      </item>  </items>';  
Anyone know how to fix this problem?

No comments:

Post a Comment