RE: str:split

[email protected]
Newsgroups gmane.text.xml.xslt.extensions
Message-ID <C37B4F61198A85409E4FF7D61A820C8838C8EC7B@lngseaexcp001.legal.regn.net>
nicolas boussekeyt wrote:
> Have you an example to using str:plit because i'm a beginner with xslt.
> I don't know how i can using element token in my xslt file.

Here is one usage:

<xsl:variable name="tokens">
  <xsl:call-template name="str:split">
    <xsl:with-param name="string" select="SomeElement"/>
    <xsl:with-param name="pattern" select="' - '"/>
  </xsl:call-template>
</xsl:variable>

<xsl:variable name="firstToken" select="normalize-space(
                              msxsl:node-set($tokens)/token[1])"/>

Note that I'm using MSXML as the processor so you will need to use
your processor's equivalent node-set function.

PS: I sanitized the above from the real application it is used in so 
I may have fat fingered something.

-- 
Kipp E. Howard
Sr. Software Engineer, LexisNexis File & Serve
Phone: 425.372.1837 or 800.774.7317 ext 1837
Email: [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.