2013-08-07 22 views
1

我正在使用XSL根據Excel工作表中的值爲不同的變量創建特定的URL。我有一切工作期望,我目前不得不單擊創建的鏈接來打開iframe中的URL。我希望能夠在沒有點擊的情況下完成此操作,因此鏈接將在頁面打開時加載。下面是相關的代碼:在iframe中自動打開URL(XSL)

<xsl:when test="FieldName[starts-with(., 'UniqueID')]"> 
<b> 
    <a target="IFRAME"> 
    <xsl:attribute name="href"> 
    file:///C:/Users/me/documents/<xsl:value-of select="FieldValue"/>.html 
    </xsl:attribute> 
    <xsl:value-of select="FieldValue"/> 
    </a> 
</b> 
</xsl:when> 

回答

0

您可以直接創建的iframe:

<xsl:when test="FieldName[starts-with(., 'UniqueID')]"> 
    <iframe> 
    <xsl:attribute name="src"> 
     file:///C:/Users/me/documents/<xsl:value-of select="FieldValue"/>.html 
    </xsl:attribute> 
    </iframe> 
</xsl:when> 
+0

這個工作!感謝您的幫助! – MGlassman

+0

@格拉斯曼:你可以把它標記爲正確答案嗎? (點擊答案旁邊的複選標記) – MiMo