[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

functions and sequences

Subject: functions and sequences
From: Bruce D'Arcus <bdarcus@xxxxxxxxxxxxx>
Date: Sun, 12 Dec 2004 18:09:20 -0500
xsl function
I've run across this issue in a different context, but can't figure out how to apply it here.

I have this function (within a large stylesheet). It works if I comment out the two lines indicated with the comments, but I get a "E net.sf.saxon.xpath.DynamicError: A sequence of more than one item is not allowed as the result of function bib:reftype()" error otherwise. Is there some way to get this to work? I'm not really sure how much of the related code I need to show to have this make any sense!

<xsl:function name="bib:reftype" as="xs:string">
<xsl:param name="bibref" as="element(mods:mods)?"/>
<xsl:choose>
<xsl:when test="$bibref/mods:relatedItem/@type = 'host'">
<xsl:variable name="issuance" select="$bibref/mods:relatedItem/mods:originInfo/mods:issuance"/>
<xsl:choose>
<xsl:when test="bib:refclass($bibref) = 'part-inSerial'">
<xsl:text>article</xsl:text>
<!-- this code introduces a sequence error; don't know why -->
<xsl:text>-</xsl:text>
<xsl:value-of select="$bibref/mods:relatedItem/mods:genre"/>
</xsl:when>
<xsl:when test="bib:refclass($bibref) = 'part-inMonograph'">
<xsl:choose>
<xsl:when test="$bibref/mods:genre">
<xsl:value-of select="$bibref/mods:genre"/>
</xsl:when>
<xsl:otherwise>
<xsl:text>chapter</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$bibref/mods:genre"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>book</xsl:otherwise>
</xsl:choose>
</xsl:function>


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.