Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with code

Status
Not open for further replies.

Endbringer

Technical User
Jan 18, 2002
28
0
0
US
I've got an XML file that contains links to some DWF files. I've created a XSL to display it in IE. My problem is that I want the links to open in a new window. Sounds pretty easy, except that when it opens up the new window, it replaces the orginal window with "[object]" typed in it. The whole point of openning the new window was to keep the links open. Here's a sample of my XML and XSL.
-----XML-------
<?xml version=&quot;1.0&quot;?>
<?xml-stylesheet type=&quot;text/xsl&quot; href=&quot;../../ProjectSheetList.xsl&quot;?>
<plan>
<planName>Keystone Little League Project</planName>
<sheetList>
<sheet name=&quot;1&quot; tif=&quot;001&quot; desc=&quot;Title Sheet&quot;/>
<sheet name=&quot;2&quot; tif=&quot;002&quot; desc=&quot;Abbreviations, Legend and General Notes&quot;/>
<sheet name=&quot;3&quot; tif=&quot;003&quot; desc=&quot;Site Dimensional Layout&quot;/>
</sheetList>
</plan>

------------XSL----------------
<?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?>
<xsl:stylesheet xmlns:xsl=&quot; version=&quot;1.0&quot;>
<xsl:eek:utput method=&quot;xml&quot; indent=&quot;yes&quot; omit-xml-declaration=&quot;yes&quot;/>
<xsl:template match=&quot;/&quot;>
<html>
<head>
</head>
<body>
<xsl:apply-templates/>
</body>
</html>
</xsl:template>
<xsl:template match=&quot;plan&quot;>
<h2>
<xsl:value-of select=&quot;planName&quot;/>
</h2>
<table border=&quot;0&quot;>
<xsl:apply-templates select=&quot;sheetList&quot;/>
</table>
</xsl:template>
<xsl:template match=&quot;sheetList&quot;>
<tr bgcolor=&quot;#F0F1F0&quot;>
<td/>
<td style=&quot;font-weight: bold&quot;>Sheet Number and Sheet Name</td>
<td style=&quot;font-weight: bold&quot;>TIF Number</td>
</tr>
<xsl:apply-templates select=&quot;sheet&quot;/>
</xsl:template>
<xsl:template match=&quot;sheet&quot;>
<xsl:variable name=&quot;cell-color&quot;>
<xsl:choose>
<xsl:when test=&quot;position() mod 2 = 0&quot;>#FFFFFF</xsl:when>
<xsl:eek:therwise>#C6DBF7</xsl:eek:therwise>
</xsl:choose>
</xsl:variable>
<tr bgcolor=&quot;{$cell-color}&quot;>
<td align=&quot;right&quot;>
<a>
<xsl:attribute name=&quot;href&quot;>
javascript:eek:pen(&quot;<xsl:value-of select=&quot;./@name&quot;/>.dwf&quot;,&quot;dwfWin&quot;,&quot;toolbar='0',location='no',menubar='0'&quot;)
</xsl:attribute>
<xsl:value-of select=&quot;./@name&quot;/>
</a>
</td>
<td>
<a>
<xsl:attribute name=&quot;href&quot;>
javascript:eek:pen(&quot;<xsl:value-of select=&quot;./@name&quot;/>.dwf&quot;,&quot;dwfWin&quot;,&quot;toolbar='0',location='no',menubar='0'&quot;)
</xsl:attribute>
<xsl:value-of select=&quot;./@desc&quot;/>
</a>
</td>
<td style=&quot;width: 20pt;align: center&quot;>
<xsl:value-of select=&quot;./@tif&quot;/>
</td>
</tr>
</xsl:template>
</xsl:stylesheet>
-----------------------------
Thanks in advance.
 
I've figured a way around it, by adding a onlick attribute calling a javascript function instead of using the href. I still would like to know why it replaces the links page when it's supposed to open a new window.
 
Oops. The function works great, except that if you try to open another link, it always opens up the same dwf. So I'm back to square one. Any ideas?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top