Click to See Complete Forum and Search --> : XSL newbie


pkb2
05-23-2003, 10:19 AM
I am tring to findout the syntax to open a html file in a target frame within a XSL choose - otherwise function. Does anyobe know how to do this?

I've attached a copy of my XSL file. I want to be able to open a new html file in a target frame if the customer id is valid (ie within my XSL:choose -> XSL:otherwise)

<?xml version="1.0" encoding="ISO-8859-1"?>

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/TR/xhtml1/strict">

<xsl:template match="/">
<html>
<body topmargin="10" leftmargin="10" bgcolor="#000000" text="#C0C0C0">

<xsl:choose>
<xsl:when test="Cust/Customers[@error='notexist']">
Customer ID <xsl:value-of select="Cust/Customers[@msg]"/> does not exist
</xsl:when>
<xsl:otherwise>
<xsl:for-each select="Cust/Customers">
<font size="6" color="#ff667f">Welcome </font>
<span style="color:#ccffff"><font size="6">
<xsl:value-of select="@fname"/></font>
</span>
<br />
Customer ID:
<span style="color:#ff9900">
<xsl:value-of select="@cid"/>
</span>
<br />
First Name:
<span style="color:#ff9900">
<xsl:value-of select="@fname"/>
</span>
<br />
Last Name:
<span style="color:#ff9900">
<xsl:value-of select="@lname"/>
</span>
<br />
Address:
<span style="color:#ff9900">
<xsl:value-of select="@address"/>
</span>
<br />
Email Address:
<span style="color:#ff9900">
<xsl:value-of select="@email"/>
</span>
</xsl:for-each>
</xsl:otherwise>
</xsl:choose>

</body>
</html>
</xsl:template>
</xsl:stylesheet>

tobysaville
05-28-2003, 09:08 PM
How are you compiling this? on the fly initialised with javascript?

The only way i could think to do it would be to print javascript code during the XML processing that set the location property of the frame you were targeting.

Dunno if that would work, but its the only way i can think to do it.

tobes