<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Error Processing XML Content with the JavaScript API in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/error-processing-xml-content-with-the-javascript-api/m-p/190014#M143144</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Here are some great Tutorials and Documents on XML Processing with E4X (ECMAScript for XML aka JavaScript for XML)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;W3Schools E4X Tutorial: &lt;/SPAN&gt;&lt;A href="http://www.w3schools.com/e4x/default.asp" rel="nofollow noopener noreferrer"&gt;http://www.w3schools.com/e4x/default.asp&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;DevX Article: &lt;/SPAN&gt;&lt;A href="http://www.devx.com/webdev/Article/33393/1763/page/1" rel="nofollow noopener noreferrer"&gt;http://www.devx.com/webdev/Article/33393/1763/page/1&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;E4X Specification: &lt;/SPAN&gt;&lt;A href="http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-357.pdf" rel="nofollow noopener noreferrer"&gt;http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-357.pdf&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 02 Nov 2008 03:22:20 GMT</pubDate>
    <dc:creator>stevewickii</dc:creator>
    <dc:date>2008-11-02T03:22:20Z</dc:date>
    <item>
      <title>Error Processing XML Content with the JavaScript API</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/error-processing-xml-content-with-the-javascript-api/m-p/190012#M143142</link>
      <description>RhinoScript supports ECMAscript for XML (E4X).&amp;nbsp; I created a document under Company Home using DM Forms (XForms and an XML Schema definition for ProductApplication).&amp;nbsp; In the JavaScript file for my Web Script I am trying to select Documents under Company Home that are of type text/xml and have an elem</description>
      <pubDate>Sun, 02 Nov 2008 00:05:50 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/error-processing-xml-content-with-the-javascript-api/m-p/190012#M143142</guid>
      <dc:creator>stevewickii</dc:creator>
      <dc:date>2008-11-02T00:05:50Z</dc:date>
    </item>
    <item>
      <title>Re: Error Processing XML Content with the JavaScript API</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/error-processing-xml-content-with-the-javascript-api/m-p/190013#M143143</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Here's why!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Exerpt from the Mozilla Developer Center (&lt;/SPAN&gt;&lt;A href="https://developer.mozilla.org/en/E4X" rel="nofollow noopener noreferrer"&gt;https://developer.mozilla.org/en/E4X&lt;/A&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;E4X doesn't support parsing XML declaration ( &amp;lt;?xml version=…?&amp;gt;) (see bug 336551 ). You may get SyntaxError "xml is a reserved identifier" (despite the XML being in a string).&lt;BR /&gt;&lt;BR /&gt;Workaround:&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;var response = xmlhttprequest.responseText; // bug 270553&lt;BR /&gt;response = response.replace(/^&amp;lt;\?xml\s+version\s*=\s*(["'])[^\1]+\1[^?]*\?&amp;gt;/, ""); // bug 336551&lt;BR /&gt;var e4x = new XML(response);&lt;BR /&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;Alfresco Workaround:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;var content = new XML(node.content.replaceAll("(?s)&amp;lt;\\?xml .*?\\?&amp;gt;\\s*", "")); // Workaround: Mozilla Bug 336551&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;STRONG&gt;Edit 11/2/2008 10:14PM:&lt;/STRONG&gt;&lt;SPAN&gt; Be careful that you don't include any whitespace/newline characters before the first XML element in the node.content, otherwise &lt;/SPAN&gt;&lt;EM&gt;new XML("\r\n&amp;lt;test&amp;gt;Test Successful&amp;lt;/test&amp;gt;")&lt;/EM&gt;&lt;SPAN&gt; will create a blank XML text node, which can be very confusing, but it's part of the E4X specification.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 02 Nov 2008 00:15:04 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/error-processing-xml-content-with-the-javascript-api/m-p/190013#M143143</guid>
      <dc:creator>stevewickii</dc:creator>
      <dc:date>2008-11-02T00:15:04Z</dc:date>
    </item>
    <item>
      <title>Re: Error Processing XML Content with the JavaScript API</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/error-processing-xml-content-with-the-javascript-api/m-p/190014#M143144</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Here are some great Tutorials and Documents on XML Processing with E4X (ECMAScript for XML aka JavaScript for XML)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;W3Schools E4X Tutorial: &lt;/SPAN&gt;&lt;A href="http://www.w3schools.com/e4x/default.asp" rel="nofollow noopener noreferrer"&gt;http://www.w3schools.com/e4x/default.asp&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;DevX Article: &lt;/SPAN&gt;&lt;A href="http://www.devx.com/webdev/Article/33393/1763/page/1" rel="nofollow noopener noreferrer"&gt;http://www.devx.com/webdev/Article/33393/1763/page/1&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;E4X Specification: &lt;/SPAN&gt;&lt;A href="http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-357.pdf" rel="nofollow noopener noreferrer"&gt;http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-357.pdf&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 02 Nov 2008 03:22:20 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/error-processing-xml-content-with-the-javascript-api/m-p/190014#M143144</guid>
      <dc:creator>stevewickii</dc:creator>
      <dc:date>2008-11-02T03:22:20Z</dc:date>
    </item>
    <item>
      <title>Re: Error Processing XML Content with the JavaScript API</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/error-processing-xml-content-with-the-javascript-api/m-p/190015#M143145</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;HI&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've used this to remove XML first line.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;var content = new XML(node.content.replaceAll("(?s)&amp;lt;\\?xml .*?\\?&amp;gt;\\s*", ""));&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;It works fine.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now I need to remove the xmlns form my tag. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;lt;nfeProc xmlns="&lt;A href="http://www.portalfiscal.inf.br/nfe" rel="nofollow noopener noreferrer"&gt;http://www.portalfiscal.inf.br/nfe&lt;/A&gt;" versao="2.00"&amp;gt;&lt;BR /&gt;&amp;lt;NFe xmlns="&lt;A href="http://www.portalfiscal.inf.br/nfe" rel="nofollow noopener noreferrer"&gt;http://www.portalfiscal.inf.br/nfe&lt;/A&gt;"&amp;gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I found some clues on forums but nothing works for me.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Any help with this please?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Jun 2014 15:26:16 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/error-processing-xml-content-with-the-javascript-api/m-p/190015#M143145</guid>
      <dc:creator>valfontanette</dc:creator>
      <dc:date>2014-06-13T15:26:16Z</dc:date>
    </item>
  </channel>
</rss>

