I have set of class and in every class it's filed ... each filed in tag (TemplateField name=””) and it's type in tag (TemplateFieldType pureName="") like this :
<pre lang="xml">-<class>
-<TemplateDef title="false" alias="Employee">
-<fields relType="0">
-<TemplateField name="perso" inherited="false" description="" >
-<fieldType number="2">
<TemplateFieldType pureName="String" dis="" />
</fieldType>
</TemplateField>
</fields>
-</class>
I need when I read this file to get for each class it's fildes and for every fileds it's type like this :
Employee
String perso
I have a lot of class and a lot of own fileds ... But I here put an example ... I knew I can get the name of class by code :
function myFunction(xml) {
var x, i, xmlDoc, txt;
xmlDoc = xml.responseXML;
txt = "";
x = xmlDoc.getElementsByTagName('TemplateDef');
for (i = 0; i < x.length; i++) {
txt += x[i].getAttribute('alias') + "<br>";
}
in my code I get the name of my class ... But How I can to get it's fileds ... I did not knew How to get the fileds and it's type from the xml file above ?
there are any method to get them by name of class (for example "perso") any help?
What I have tried:
My code above ... But I need to help ...any help ?