Need javascript sample code for XML parsing

cancel
Showing results for 
Search instead for 
Did you mean: 
jpbuttet
Active Member II

Need javascript sample code for XML parsing

Jump to solution

 

Hello all,

I just posted this in the ADF Forum forum but I am not sure this was the right place. I think this forum is more appropriate. Again my post:

 

My goal is to write, by using the share javascript console, a javascript file that can be fired by a share folder rule. When fired the javascript program would retrieve some information within a XML file,  Writing a folder rule is not a problem for me.

I am just struggling to find a very basic XML parsing  javascript sample code that is applicable to my environment  and that I could study, play with and use as good starting point for my needs.

I found that excellent link but could not find what I need:

https://hub.alfresco.com/t5/alfresco-content-services-hub/javascript-api-cookbook/ba-p/293260#toc-hI...

Any explanation , sample code  or link would be much appreciated.

Any book recommandation about that matter would be also appreciated.

 

PS: I run a dockerized Alfresco:

Alfresco Share v6.1.0

(rfc7f986e4267e4e4d9c7572b73ab200a6a578c93-b6, Aikau 1.0.101.16, Spring Surf 6.1.0, Spring WebScripts 6.20, Freemarker 2.3.20-alfresco-patched, Rhino 1.7R4-alfresco-patched, Yui 2.9.0-alfresco-20141223)

Alfresco Community v6.1.2

(r589dc49b-b205) schema 13001

 

Thank you in advance.

Best regards.

Jean-Pierre.

1 Solution

Accepted Solutions
angelborroy
Alfresco Employee

Re: Need javascript sample code for XML parsing

Jump to solution

You can use default XML JavaScript API.

var docXml = new XML(document.content);
document.name = docXml.entry.name; 
Hyland Developer Evangelist

View solution in original post

2 Replies
angelborroy
Alfresco Employee

Re: Need javascript sample code for XML parsing

Jump to solution

You can use default XML JavaScript API.

var docXml = new XML(document.content);
document.name = docXml.entry.name; 
Hyland Developer Evangelist
jpbuttet
Active Member II

Re: Need javascript sample code for XML parsing

Jump to solution

Helo,

Thank you for your answer. 

My javascript console looks like broken because some code sample doesn't run as expected.

As a first step I have to check the console. I just sent you a related message on github.

 

Best regards.

 

Jean-Pierre