function crearElemento(obj,name,value) set doc = obj'.xmldocument 'referencia al documento set dat = doc.createtextnode(value) 'crea valor textual set ele = doc.createelement(name) 'crea tag ele.appendchild dat 'crea etiqueta con valor set crearElemento = ele end function '********************************************************** function addElemento(nodesource,nodetarget) set addElemento = nodesource.appendchild (nodetarget) end function '********************************************************** function addAttribute(obj,node,tagname,value) if value <> "" then set doc = obj'.xmldocument 'referencia al documento set attr = doc.createAttribute (tagname) attr.nodevalue = value node.setattributenode attr end if end function '********************************************************** function lestAttribute(node,tagname) set attr = node.getattributenode( tagname ) node.removeattributenode attr end function '********************************************************** function lestElement(node,tagname) set elem = node.selectsinglenode( tagname ) node.removechild elem end function '********************************************************** function SubmitXML(doc,pagename) set http = createobject("microsoft.xmlhttp") http.open "post",pagename,false http.send doc SubmitXML = http.responsetext end function '********************************************************** function Estatus( docsend ) errores="" ierror = 0 set nodelist = docsend.selectnodes("//Error") for each x in nodelist errores= errores & x.getattribute("description") & chr(13) if x.getattribute("number") = "-3" then ierror = -3 end if next if len(errores)>0 then msgbox errores Estatus= -1 if ierror = -3 then Estatus= -3 end if exit function end if set nodelist = docsend.selectnodes("//Ok") for each x in nodelist errores= errores & x.getattribute("description") & chr(13) next if len(errores)>0 then msgbox errores Estatus= 1 exit function end if Estatus= 0 end function