Hi,

We recently upgraded one server from 4.2.1 to 4.2.7, and I noticed a difference 
between how Marklogic treats "empty" in xslt.

I had to change :

   empty($subfields)

to

   subfields=''



In my code, I call a template like this, with our without "subfields":



<xsl:call-template name="displayAll">

            <xsl:with-param name="label">LC control no.</xsl:with-param>

            <xsl:with-param name="tag">010</xsl:with-param>

            <xsl:with-param name="subfields">a</xsl:with-param>

</xsl:call-template>

or

<xsl:call-template name="displayAll">

            <xsl:with-param name="label">Main title</xsl:with-param>

            <xsl:with-param name="tag">245</xsl:with-param>

</xsl:call-template>



In the template under 4.2.1:



<xsl:template name="displayAll">

            <xsl:param name="label"/>

            <xsl:param name="tag"/>

            <xsl:param name="subfields"/>

            <xsl:choose>

                        <xsl:when test="empty($subfields)">[Process without 
subfields]</xsl:when>

                        <xsl:otherwise> [Process with subfields]</xsl:otherwise>

            </xsl:choose>



My new test under 4.2.7 is:

                        <xsl:when test="$subfields=''  ">Process without 
subfields</xsl:when>



(Those are two single quotes, not a double quote, after =)



Did something change in your xslt processor to affect this?  I didn't see it in 
the upgrade notes.



Thanks,
Nate
---------------------------------------------------------------
Nate Trail
---------------------------------------------------------------
Network Development and MARC  Standards Office
Technology Policy Mail stop 4402
Library Services
Library of Congress
202-707-2193
[email protected]



_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to