Using the getXML Subroutine

The getXML subroutine accepts the root parameter, which contains the value of the root node in the lingo file (de_lingo.xml, en_lingo.xml, or ja_lingo.xml). The script loops through the attributes of the root node in the lingo XML file and adds each atttribute to the xmlResult file. This code adds the first node to the result XML file and attaches the code page and character set attributes, which must appear in the first line of an XML document. If you clicked German this node has the attributes "CHARSET = iso-8859-1" and "CODEPAGE = 1252".

For each attrib in xmlLRoot.attributes
   root.setAttribute attrib.nodeName,Decode(attrib.nodeValue)
Next

Next the script executes two loops. The outer loop steps through the elements in the arena file and uses the attributes "ID = btn1" and "ID = lbl1" of the respective BUTTON and LABEL elements to link to elements in the the lingo file (skipping the first element, which is already present in the XML document) and adds additional attributes to the *result.xml file. Notice that the node value of each attribute is submitted to the Decode function. Using the Server-Side Decode Function describes the purpose of this function.

For Each element in root.childNodes
   strNode = "//" & element.nodeName & "[@ID='"  & element.getAttribute("ID")  & "']"
   Set oElement =  xmlLingo.selectSingleNode(strNode)
   For Count = 1 to  oElement.attributes.length -1 
      Set attrib = oElement.attributes(Count)
      element.setAttribute attrib.nodeName,Decode(attrib.nodeValue)
   Next
Next