AnsweredAssumed Answered

Vague XML Syntax error when processing JSON for atom feed

Question asked by ashex on Jun 11, 2013
Latest reply on Jun 12, 2013 by ashex
I've run into an incredibly very frustrating error. This was working without issue on Friday and I deployed it last night, found out today that the modified timestamp isn't properly formatted so I reformatted it and built a jar for testing. This error comes up:

05110009 Failed to execute script 'classpath*:alfresco/site-webscripts/org/tibco/components/dashlets/recent-docs.get.js': 05110008 SyntaxError: illegally formed XML syntax (jar:file:/usr/share/tomcat6/shared/lib/recent-docs.jar!/alfresco/site-webscripts/org/tibco/components/dashlets/recent-docs.get.js#20(eval)#1)

So I revert the changes and the exact same error is displayed. Can anyone tell me why I'm receiving this?

Here's an example of the JSON output generated by the repo webscript:

            "site": "swsdp",
            "nodeRef": "workspace://SpacesStore/1a0b110f-1e09-4ca2-b367-fe25e4964a4e",
            "id": "1a0b110f-1e09-4ca2-b367-fe25e4964a4e",
            "name": "Project Contract.pdf",
            "title": "Project Contract for Green Enery",
            "creator": "abeecher",
            "description": "Conract for the Green Energy project",
            "categories": [
            "created": "15 Feb 2011 21:26:54 PM (UTC)",
            "modified": "14 Jun 2011 10:28:54 AM (UTC)"
            "site": "swsdp",
            "nodeRef": "workspace://SpacesStore/05dedd34-9d9d-48d9-9af6-c81b555541c9",
            "id": "05dedd34-9d9d-48d9-9af6-c81b555541c9",
            "name": "WebSiteReview.mp4",
            "title": "WebSiteReview.mp4",
            "creator": "abeecher",
            "description": "This is a video of the mock up to show the planned structure for the new web site.",
            "categories": [
            "created": "08 Mar 2011 10:35:10 AM (UTC)",
            "modified": "08 Mar 2011 10:37:43 AM (UTC)"

And the share webscript stuff


  <shortname>Recently Modified Documents</shortname>
  <description>Retrieve Recently Modified content for a site</description>
    <description><![CDATA[site name]]></description>
  <format default="html">argument</format>


function main()
    for (var arg in args)
      if (arg == "site")
      { = args[arg];
        // call the repository to get recent documents
        var connector = remote.connect("alfresco");
        var json ="/recent-docs?site=" + escape(;
        if (json.status == 200)
                obj = eval("(" + json + ")");
       = obj["documents"];
                obj = eval("(" + json + ")");
       = "Error";
       = obj;




<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="">
  <generator version="${server.version}">Alfresco (${server.edition})</generator>
  <link rel="self" href="${absurl(url.full)?xml}" />
  <title>Site: ${site}</title>
  <subtitle>Alfresco Recently Modified Documents</subtitle> 
<#list docs as child>
  <entry xmlns=''>
    <link href="${absurl(url.context)}/page/document-details?nodeRef=${child.nodeRef}"/>
       ${msg("feed.uploaded",, child.creator)}<br />
    <#if child.modifier?exists>${msg("feed.modified", child.modified, child.modifier)}<br /></#if>
    ${child.description!""}<br />
     <#if child.categories[0]?exists>
     ${msg("feed.categories")} <#list child.categories as category> ${}<#if category_has_next>, </#if></#list></#if><br />

I've been hacking at this trying various things without success, going to try turning everything into a string or something next.