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

RE: Creating List with xsl:function

Subject: RE: Creating List with xsl:function
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Sat, 18 Nov 2006 08:59:16 -0000
xquery unexpected token function
You might find the Saxon error messages more helpful:

Error at xsl:sequence on line 7 of file:/c:/temp/test.xsl:
  XPST0003: XPath syntax error at char 26 on line 7 in {('1', 'a', 'i', 'A',
'I') coun...}:
    Unexpected token "<function>(" beyond end of expression

Error at ol on line 11 of file:/c:/temp/test.xsl:
  XPST0003: XPath syntax error at char 6 on line 11 in
{enum{$ACM:list-format(.}:
    expected "<name>", found "<function>("

The first is because you've omitted the "[" at the start of the predicate.

The second is because you've got an unwarranted "$" before your function
call.

Michael Kay
http://www.saxonica.com/

 

> -----Original Message-----
> From: Philip Vallone [mailto:philip.vallone@xxxxxxxxxxx] 
> Sent: 18 November 2006 01:16
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: RE:  Creating List with xsl:function
> 
> Thank you for the help. Here is what I have so far:
> 
> 	<xsl:function name="ACM:list-format" as="xs:string">
> 		<xsl:param name="node" as="node()"/>
> 		<xsl:sequence select="('1', 'a', 'i', 'A', 'I')
> count($node/ancestor::ACM:Para) mod 5 + 1] "/>
> 	</xsl:function>
> 	<xsl:template match="ACM:list">
> 		<xsl:for-each select="ACM:Para">
> 			<ol class="enum{$ACM:list-format(.)}">
> 				<xsl:apply-templates select="."/>
> 			</ol>
> 		</xsl:for-each>
> 	</xsl:template>
> 
> Now I am getting the following error message:
> 
> Invalid XPath 2.0 expression Unexpected token - "(.)"
> 
> Any ideas?
> 
> Thanks,
> 
> Phil

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.