Subject: Re: [xsl] Re: Create a node set and then apply a template to it From: "paul morgan" <pmorg@xxxxxxxxx> Date: Mon, 29 Apr 2002 09:54:22 -0700 |
Hi Dimitre, I must be missing something (not a big surprise) ... when I run the sample code you supplied I get the following XSLT error: Can not convert #RTREEFRAG to a NodeList! I'm using Xalan-J 2.3.1, from FXSL I grabbed "strSplit-to-Words.xsl" and "strfoldl.xsl" (the Xalan versions), and in the example, I substituted: xmlns:vendor="http://xml.apache.org/xalan" for: xmlns:vendor="urn:schemas-microsoft-com:xslt" The interesting thing is that if I comment out the line: <xsl:apply-templates select="vendor:node-set($vwordNodes)/*"/> I still get the error ... does this make any sense? Thanks -- On Sat, 27 Apr 2002 06:40:39 Dimitre Novatchev wrote: >You can tokenize the text using the str-split-to-words template from >FXSL. > >If you capture the result into a xsl:variable, then convert it from an >RTF to a node-set, then you'd be able to apply other templates on this >node-set. In your concrete case this stylesheet: > ><xsl:stylesheet version="1.0" > xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > xmlns:vendor="urn:schemas-microsoft-com:xslt" >> > > <xsl:import href="strSplit-to-Words.xsl"/> > > <xsl:output indent="yes" omit-xml-declaration="yes"/> > > <xsl:template match="/"> > <xsl:variable name="vwordNodes"> > <xsl:call-template name="str-split-to-words"> > <xsl:with-param name="pStr" select="/"/> > <xsl:with-param name="pDelimiters" > select="', '"/> > </xsl:call-template> > </xsl:variable> > > <xsl:apply-templates select="vendor:node-set($vwordNodes)/*"/> > </xsl:template> > > <xsl:template match="word"> > <xsl:value-of select="concat(position(), ' ', ., ' ')"/> > </xsl:template> > ></xsl:stylesheet> See Dave Matthews Band live or win a signed guitar http://r.lycos.com/r/bmgfly_mail_dmb/http://win.ipromotions.com/lycos_020201/splash.asp XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Re: Create a node set and the, Dimitre Novatchev | Thread | [xsl] HTML: unordered list within , Rich Garcia |
[xsl] following sibling attribute, Sripriya Venkatarama | Date | Re: [xsl] problem in using * as a d, Oleg Tkachenko |
Month |