xsl-list
[Top] [All Lists]

[xsl] Why doesn test work in one case, but not another???

2006-05-10 11:46:35
Hi,

I am using XML Version 1 and have two situations of search results pages. In one, a test between a text variable in Filemaker Pro and a text value works perfectly, but in another, it doesn't. Unfortunately, I can't see what is different about them. I have included the front part from both and the test areas from both:

Works:

Front Part:

<?xml version="1.0" encoding="ISO-8859-1"?>
<?xslt-cwp-query param="-grammar=fmresultset"?>
<xsl:stylesheet version="1.0"
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
        xmlns:fmrs="http://www.filemaker.com/xml/fmresultset";
        xmlns:fmq="http://www.filemaker.com/xml/query";
        xmlns:fmxslt="xalan://com.fmi.xslt.ExtensionFunctions"
        exclude-result-prefixes="xsl fmrs fmq fmxslt">

        <xsl:import href="cdml2xsl_includes.xsl"/>
<xsl:variable name="_errorcode" select="/fmrs:fmresultset/fmrs:error/@code"/> <xsl:variable name="token.error" select="$request-query/fmq:query/fmq:parameter[(_at_)name = '-token.error']"/> <xsl:variable name="token.errnum" select="$request-query/fmq:query/fmq:parameter[(_at_)name = '-token.errnum']"/>

        <xsl:param name="authenticated-xml-base-uri"/>
        <xsl:param name="request-query"/>
<xsl:variable name="current-max"><xsl:call-template name="get-current-max"/></xsl:variable> <xsl:variable name="current-skip"><xsl:call-template name="get-current-skip"/></xsl:variable> <xsl:variable name="link-first"><xsl:call-template name="get-link-first"/></xsl:variable> <xsl:variable name="row-count"><xsl:value-of select="/fmrs:fmresultset/fmrs:resultset/@count"/></xsl:variable> <xsl:variable name="link-last"><xsl:call-template name="get-link-last"/></xsl:variable> <xsl:variable name="link-next"><xsl:call-template name="get-link-next"/></xsl:variable> <xsl:variable name="link-previous"><xsl:call-template name="get-link-previous"/></xsl:variable>
        <xsl:output method="html" encoding="ISO-8859-1"/>

        <xsl:template match="/fmrs:fmresultset">
Test Portion:

<td valign="top" headers="chgappl">
<p><b>MSM: </b><xsl:value-of select="$record/fmrs:field[(_at_)name = 'MSMApproval']/fmrs:data[1]"/><br/> <xsl:value-of select="$record/fmrs:field[(_at_)name = 'MSMDate']/fmrs:data[1]"/><xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text><br/> <xsl:choose><xsl:when test="'MssnTer' = 'Y'"> <b>Terra MD: </b><xsl:value-of select="$record/fmrs:field[(_at_)name = 'MDApproval']/fmrs:data[1]"/><br/> <xsl:value-of select="$record/fmrs:field[(_at_)name = 'MDDate']/fmrs:data[1]"/><xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text><br/>
                                        </xsl:when><xsl:otherwise>
<xsl:choose><xsl:when test="'MDApproval' != ''"> <b>Terra MD: </b><xsl:value-of select="$record/fmrs:field[(_at_)name = 'MDApproval']/fmrs:data[1]"/><br/> <xsl:value-of select="$record/fmrs:field[(_at_)name = 'MDDate']/fmrs:data[1]"/><xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text><br/>

            </xsl:when></xsl:choose>
         </xsl:otherwise></xsl:choose>
<xsl:choose><xsl:when test="'MssnAqu' = 'Y'">
<b>Aqua MD: </b><xsl:value-of select="$record/fmrs:field[(_at_)name = 'AqMDApproval']/fmrs:data[1]"/><br/> <xsl:value-of select="$record/fmrs:field[(_at_)name = 'AqMDDate']/fmrs:data[1]"/><xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text><br/>

         /xsl:when></xsl:choose>
<xsl:choose><xsl:when test="'MssnAur' = 'Y'">
<b>Aura MD: </b><xsl:value-of select="$record/fmrs:field[(_at_)name = 'AuMDApproval']/fmrs:data[1]"/><br/> <xsl:value-of select="$record/fmrs:field[(_at_)name = 'AuMDDate']/fmrs:data[1]"/><xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text><br/>

</xsl:when></xsl:choose><b>MM: </b><xsl:value-of select="$record/fmrs:field[(_at_)name = 'MMApproval']/fmrs:data[1]"/><br/> <xsl:value-of select="$record/fmrs:field[(_at_)name = 'MMDate']/fmrs:data[1]"/><xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text><br/>
                <xsl:choose><xsl:when test="'MssnLnch' = 'Y'">
<b>Launch MM: </b><xsl:value-of select="$record/fmrs:field[(_at_)name = 'LnchMMApproval']/fmrs:data[1]"/><br/> <xsl:value-of select="$record/fmrs:field[(_at_)name = 'LnchMMDate']/fmrs:data[1]"/> <xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text></xsl:when><xsl:otherwise>
                <xsl:choose><xsl:when test="'LnchMMApproval' != ''">
<b>Launch MM: </b><xsl:value-of select="$record/fmrs:field[(_at_)name = 'LnchMMApproval']/fmrs:data[1]"/><br/> <xsl:value-of select="$record/fmrs:field[(_at_)name = 'LnchMMDate']/fmrs:data[1]"/><xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text>
        </xsl:when></xsl:choose>
</xsl:otherwise></xsl:choose><xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text></p>

Doesn't Work:

Front Part:

<?xml version="1.0" encoding="ISO-8859-1"?>
<?xslt-cwp-query param="-grammar=fmresultset"?>
<xsl:stylesheet version="1.0"
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
        xmlns:fmrs="http://www.filemaker.com/xml/fmresultset";
        xmlns:fml="http://www.filemaker.com/fmpxmllayout";
        xmlns:fmq="http://www.filemaker.com/xml/query";
        xmlns:fmxslt="xalan://com.fmi.xslt.ExtensionFunctions"
        exclude-result-prefixes="xsl fmrs fml fmq fmxslt">


        <xsl:import href="cdml2xsl_utilities.xsl"/>
        <xsl:param name="authenticated-xml-base-uri"/>
        <xsl:param name="request-query"/>
<xsl:variable name="_errorcode" select="/fmrs:fmresultset/fmrs:error/@code"/> <xsl:variable name="token.error" select="$request-query/fmq:query/fmq:parameter[(_at_)name = '-token.error']"/> <xsl:variable name="token.errnum" select="$request-query/fmq:query/fmq:parameter[(_at_)name = '-token.errnum']"/>

<xsl:variable name="current-max"><xsl:call-template name="get-current-max"/></xsl:variable> <xsl:variable name="current-skip"><xsl:call-template name="get-current-skip"/></xsl:variable> <xsl:variable name="link-first"><xsl:call-template name="get-link-first"/></xsl:variable> <xsl:variable name="row-count"><xsl:value-of select="/fmrs:fmresultset/fmrs:resultset/@count"/></xsl:variable> <xsl:variable name="link-last"><xsl:call-template name="get-link-last"/></xsl:variable> <xsl:variable name="link-next"><xsl:call-template name="get-link-next"/></xsl:variable> <xsl:variable name="link-previous"><xsl:call-template name="get-link-previous"/></xsl:variable>
        <xsl:output method="html" encoding="ISO-8859-1"/>

        <xsl:template match="/fmrs:fmresultset">

Test Portion:
        <td valign="top" width="10%">
                <xsl:choose><xsl:when test="'System' = 'A'">
<b>System A: </b><xsl:value-of select="$record/fmrs:field[(_at_)name = 'SysANode']/fmrs:data[1]"/><xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text><br/>

                </xsl:when></xsl:choose>
<xsl:choose><xsl:when test="'System' = 'B'">
<b>System B: </b><xsl:value-of select="$record/fmrs:field[(_at_)name = 'SysBNode']/fmrs:data[1]"/><xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text><br/>

                </xsl:when></xsl:choose>
<xsl:choose><xsl:when test="'System' = 'Ground Stations'">
b>GS: </b><xsl:value-of select="$record/fmrs:field[(_at_)name = 'GSNode']/fmrs:data[1]"/><xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text><br/>

                </xsl:when></xsl:choose>
<xsl:choose><xsl:when test="'System' = 'AT Server'">
<b><xsl:text disable-output-escaping="yes">At Server:&amp;nbsp;</xsl:text></b><br/>

</xsl:when></xsl:choose><xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text>
        </td>

Note: In all of these cases, the variables are defined only in Filemaker Pro.

I have studied both of these examples, but don't see why one works and one doesn't!!! Any suggestions???

Shirley Gasch
--
Shirley Gasch                                         Phone:  (301) 794-2164
Computer Sciences Corporation       Fax:    (301) 794-8355
7700 Hubble Drive, Rm N384
Lanham/Seabrook, Md.  20706         email: sgasch(_at_)csc(_dot_)com

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--