xsl-list
[Top] [All Lists]

[xsl] RE : [xsl] Creating List with xsl:function

2006-11-20 06:05:03

--- Philip Vallone <philip(_dot_)vallone(_at_)verizon(_dot_)net> a écrit :

Hi All,

I am having trouble creating list in XSLT 2.0. I am trying an example
from
XSLT 2.0 3rd edition (chapter 10) (Wrox), but having trouble getting
it to
work in my stylesheet.

The example to the book shows:

      <xsl:function name="f:olist-format" as="xs:string">
              <xsl:param name="node" as="node()"/>
              <xsl:sequence select="('1', 'a', 'i', 'A', 'I')
[count($node/ansestor::olist) mod 5 + 1] "/>
      </xsl:function>


<xsl:template match="olist">          
                      <ol class="enum{$f:list-format(.)}"> 
                              <xsl:apply-templates/> 
                      </ol>
</xsl:template>

Mine looks like this:

Namespace in SCHEMA is "ACM".
      
<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/ansestor::list) 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/>
                      </ol>
      </xsl:for-each>
</xsl:template>

I receive this error:

"Invalid XPath 2.0 expression Unexpected token. Probably missing
valid axis
name before '::'  - "::ACM:list) mod 5 + 1] ""

I assume I am not declaring the Function properly. Can the
XSL:Function be
placed anywhere in the stylesheet as long as it is a child of
</xsl:stylesheet>? Do I need to declare a namespace for a function? 
And if
so how? I am a little lost.

Thanks,

Phil




--~------------------------------------------------------------------
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>
--~--





        

        
                
___________________________________________________________________________ 
Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions ! 
Profitez des connaissances, des opinions et des expériences des internautes sur 
Yahoo! Questions/Réponses 
http://fr.answers.yahoo.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>
--~--