Q:

Setting default value on ComboBox on HTML using JavaScript ,XSLT and XML

I am trying to get a language dropdown in HTML which calls JavaScript which uses XMLT which reads an XML to have a default value of English when the page loads, can someone help?\
Please note this only runs on Internet Explorer 9 and above
The required HTML Is: 
<body onload="Start();">    
<h3 id="selectalanguage"></h3>
<h3 id="LanguageComboHere"></h3>
</body>

My JavaScript is 
function Start()
{
    LoadLanguageCombo();
    LoadCustomerCombo();
    GetLanguage();
}

function nvl(value1,value2) 
{
if (value1 == null)
return value2;

return value1;
}

function LoadLanguageCombo()
{
    var xmldoc=new ActiveXObject("Microsoft.XMLDOM");
    xmldoc.async=false;
    xmldoc.load("Language.xml");

    var xsldoc=new ActiveXObject("Microsoft.XMLDOM");
    xsldoc.async=false;

    xsldoc.load("LanguageCombo.xsl");
    alert (xmldoc.transformNod(exsldoc));
    LanguageComboHere.innerHTML=xmldoc.transformNode(xsldoc);

}

function GetLanguage(language)
{
    alert("here");
    alert(language);
    var xmldoc=new ActiveXObject("Msxml2.DOMDocument.3.0");
    var xsldoc=new ActiveXObject("MSXML2.FreeThreadedDOMDocument");
    var xslt = new ActiveXObject("MSXML2.XSLTemplate");
    var xslproc;
    var defaultlanguage = "English";
    language = nvl(language, defaultlanguage);

    alert(language);

    xmldoc.load("Language.xml")
    xsldoc.load("getLanguage.xsl");

    xslt.stylesheet = xsldoc;
    xslproc         = xslt.createProcessor();
    xslproc.input   = xmldoc;

    xslproc.addParameter("elementname", "selectalanguage");
    xslproc.addParameter("languagetype", language);
    xslproc.transform();
    selectalanguage.innerHTML = xslproc.output;

}

My XSLT is:
<?xml version='1.0'?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" >
    <xsl:output method="html" />
    <xsl:template match="/">
        <select id="selectlanguage" value="Italian"  onchange="GetLanguage(selectlanguage.value);">
            <xsl:for-each select="//language">
            <xsl:sort select="englishtype"/>
                <xsl:sort select="englishtype" />
                <xsl:variable name="language" select="englishtype" />
                <xsl:element name="option">
                    <xsl:attribute name="value">
                        <xsl:value-of select="$language" />
                    </xsl:attribute>
                    <xsl:value-of select="englishtype" />
                </xsl:element>
            </xsl:for-each>
        </select>
    </xsl:template>
</xsl:stylesheet>

My XML is:
<language>
    <englishtype>Ukrainian</englishtype>
</language>
<language>
    <englishtype>Italian</englishtype>
</language>
<language>
    <englishtype>English</englishtype>
</language>
<language>
    <englishtype>Arabic</englishtype>
</language>

A:

Your XML document is missing a root element.
The following XSL will do the job.
<?xml version='1.0'?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" >
    <xsl:output method="html" />
    <xsl:template match="/">
        <select>
            <xsl:for-each select="//language">
             <xsl:choose>
               <xsl:when test="englishtype='English'">
                 <option selected='true'><xsl:value-of select="englishtype"/></option>
               </xsl:when>
               <xsl:otherwise>
                 <option><xsl:value-of select="englishtype"/></option>
               </xsl:otherwise>
             </xsl:choose>
            </xsl:for-each>
       </select>
    </xsl:template>
</xsl:stylesheet>

