Search code examples
xmlxslthta

Embedded HTA in xslt stylesheet


Given the problem I have:

[Ie 8.0 Access Denied When Trying To Open Local Files

Is it possible to embbed an HTA application into a given xslt stylesheet? For example, given the present template:

<xsl:template match="/"> 
        <html>
            <head>
...
</head>
</html>
</xsl:template>

Is this theoretically correct?:

<xsl:template match="/"> 
        <html>
            <head>
<HTA:APPLICATION 
 APPLICATIONNAME="HTA Test"
 SCROLL="yes"
 SINGLEINSTANCE="yes"
 WINDOWSTATE="maximize"
 >
</head>
</html>
</xsl:template>

Will the HTA work if it is not explicitly saved as a HTA file?


Solution

  • You will have to open the file explicitly with mshta.exe by passing the file name of your xslt file to mshta.exe.

    For example:

    mshta "S:\test.xslt"
    

    You may have to write it as:

    C:\Windows\System32\mshta.exe "S:\test.xslt"
    

    or, to get the 32 bit version of mshta on a 64 bit OS:

    C:\Windows\SysWOW64\mshta.exe "S:\test.xslt"