That is a grand idea. I obviously took the wrong fork in the road somewhere in my trials/research.
- James
> From: christian.gruen@gmail.com
> Date: Fri, 9 Aug 2013 18:49:52 +0200
> Subject: Re: [basex-talk] Analyze-string unsupported?
> To: james.jw@hotmail.com
> CC: basex-talk@mailman.uni-konstanz.de
>
> What about simply using XQuery?…
>
> analyze-string('test MM23423 junk MM11111 junkagain man', 'MM')
> ___________________________
>
> > I am trying to use analyze-string. I have this query:
> >
> > declare namespace str = 'str.analysis';
> > declare function str:analyze-string($string as xs:string, $regex as
> > xs:string,$n as xs:integer ) as xs:string {
> > xslt:transform(<item />, (
> > <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> > version="2.0">
> > <xsl:template match='/' >
> > <xsl:analyze-string regex="{$regex}" select="'{$string}'" >
> > <xsl:matching-substring>
> > <xsl:for-each select="1 to {$n}">
> > <match>
> > <xsl:value-of select="regex-group(.)"/>
> > </match>
> > </xsl:for-each>
> > </xsl:matching-substring>
> > </xsl:analyze-string>
> > </xsl:template>
> > </xsl:stylesheet>))
> > };
> > let $item as xs:string := 'test MM23423 junk MM11111 junkagain man'
> > let $result := str:analyze-string($item, 'MM', 10)
> > return $result
> >
> > However I am getting an error that this is unsupported. Upon further
> > investigation I found that this is only available in Saxon EE. I'm guessing
> > this is my problem. Is there anything of similar functionality included in
> > basex?
> >
> > Any help would be appreciated. thanks.
> >
> > - james
> >
> > _______________________________________________
> > BaseX-Talk mailing list
> > BaseX-Talk@mailman.uni-konstanz.de
> > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
> >