global xmlObject on createObjXML(config_XML) gObjetDanalyse = new(xtra "xmlparser") gObjetDanalyse.ignoreWhiteSpace(TRUE) codeDerreur = gObjetDanalyse.parseString(config_XML) xmlObject = [:] return getXMLObject(gObjetDanalyse) end on getXMLObject(_xml) { theXML = [:] _attributes_num = _xml.attributeName.count repeat with i = 1 to _attributes_num theXML.addProp(_xml.attributeName[i],_xml.attributeValue[i]) end repeat _nodeList_num = _xml.child.count repeat with i = 1 to _nodeList_num _type = _xml.child[i].type if _type = #text then theXML.addProp("_value",_xml.child[i].text) else if _type = #element then nName = _xml.child[i].name objNode = getXMLObject(_xml.child[i]) if theXML[nName] = void then theXML.setaprop(nName,objNode) else res = theXML[nName] if ilk(theXML[nName]) <> #list then theXML[nName] = [res] theXML[nName].add(objNode) end if end if end repeat return theXML end