Re: FW: EXSLT

"James Fuller" <[email protected]> Tue, 18 Mar 2008 11:33:43 +0100
Newsgroups gmane.text.xml.xslt.extensions
Message-ID <[email protected]>
not quite sure what u mean as NodeList;

if u want to tokenize something use the string tokenize or split function

http://www.exslt.org/str/functions/tokenize/index.html

perhaps u want to convert XSLT v1 RTF to a nodeset so u can continue
working with it (#1 common issue with xslt v1)

http://www.exslt.org/exsl/functions/node-set/index.html

last note: to use EXSLT functions u need either

a) a XSLT processor that natively supports it (like saxon)

or

b) use one of the implementations (xslt pref) if it exists

hth, Jim Fuller


On Tue, Mar 18, 2008 at 11:24 AM,  <[email protected]> wrote:
>
>
>
> Within XSLT
>
> I want to convert a string in XML-format to the corresponding NodeList
>
> So from :
>
> "<DOCUMENTS><DOCUMENT>D:\ABNAMROUPLOAD.rar</DOCUMENT><DOCUMENT>D:\all-exslt.zip</DOCUMENT><DOCUMENT>D:\files.txt</DOCUMENT><DOCUMENT>D:\files.txt.bak</DOCUMENT><DOCUMENT>D:\FSO.xsl</DOCUMENT><DOCUMENT>D:\SHABNFileUpload.exe</DOCUMENT><DOCUMENT>D:\SHABUpload_drie.xsl</DOCUMENT><DOCUMENT>D:\SHABUpload_een.xsl</DOCUMENT><DOCUMENT>D:\SHABUpload_twee.xsl</DOCUMENT><DOCUMENT>D:\str.tokenize.zip</DOCUMENT></DOCUMENTS>"
>
>
>
>
>
> To a Node-list which I can than process in XSLT
>
>
>
> And I guess I can use the tokenizer for this
>
>
>
> _____________________________________________
>  From: DE DECKER RONNY
>  Sent: dinsdag 18 maart 2008 11:01
>  To: '[email protected]'
>  Subject: EXSLT
>
> Purpose :
>
> I wanted to use the tokenizer functionality
>
> Because I would like to get a directory-listing in javascript and have it
> returned as
>
> A node list and then process this list to the XMLDocument I want
>
> Process :
>
>   <msxsl:script language="JScript" implements-prefix="eff"><![CDATA[
>
>   var sTheGlobalData='hallo';
>
> 1.      The Javascript function in the XSLT-file
>
>
>
>
>
>
> function ShowFolderFileList(folderspec)
>
> {
>
>    var fso, f, fc, s;
>
>    fso = new ActiveXObject("Scripting.FileSystemObject");
>
>    f = fso.GetFolder(folderspec);
>
>    fc = new Enumerator(f.files);
>
>    s = "<?xml version='1.0' encoding='UTF-16'?><DOCUMENTS>";
>
>    for (; !fc.atEnd(); fc.moveNext())
>
>    {
>
>       s += "<DOCUMENT>" + fc.item() + "</DOCUMENT>";
>
>    }
>
>    s += "</DOCUMENTS>";
>
>
>
>   sTheGlobalData = s;
>
>    return(s);
>
> }
>
> ]]></msxsl:script>
>
> 2.      The template calling the Javascript, this stores the String in
> sTheGlobalData
>
> And shows it for debug-purposes
>
>   <xsl:template name="FILELIST">
>
>     <xsl:param name="DIRECTORY" select="''"/>
>
>     <xsl:param name="VALUE"
> select="eff:ShowFolderFileList(concat($DIRECTORY,''))"></xsl:param>
>
>     <html>
>
>       <xsl:value-of disable-output-escaping="yes" select="$VALUE"/>
>
>     </html>
>
>   </xsl:template>
>
> 3.      The call to the FileList prepares the sTheGlobalData
>
>
>
>      <xsl:call-template name="FILELIST">
>
>       <xsl:with-param name="DIRECTORY">d:\</xsl:with-param>
>
>     </xsl:call-template>
>
>
> 4.      The Call to Access the sTheGlobalData, This Should be replace by a
> Call to your Tokenizer functionality
>
>
>
>     <xsl:variable name="VALUE" select="str:tokenize(eff:TheGlobalData(),
> 'delimiters')"></xsl:variable>
>
>
>
>      5. Than processing of the returned nodelist
>
>    <xsl:call-template name= >
>
>         <xsl:with-param name="DIRXML" select="$VALUE">
>
>    </xsl:call-template name= >
>
>
>
> BUT :
>
>
>
>
> If I modify the stylesheet
>
> <?xml version="1.0"?>
>
> <xsl:stylesheet version="1.0"
>
>                 xmlns:eff="urn:my-RUPTINDICATORS"
>
>                 xmlns:str="http://exslt.org/strings"
>
>                 extension-element-prefixes="str"
>
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>
>
>
> and run it
>
> I get :
>
>
>
> Namespace 'http://exslt.org/strings' does not contain any functions
>
> Am I doing something wrong here ?
>
> Or is this URL no longer valid ?
>
>
>
>
>
> Ronny De Decker
>  Fortis Investments
>  Sr. Application Programmer
>  tel : +32 (0)2 274 83 49
>  Avenue de l'Astronomie 14
>  1210 Brussel
>  Belgium
>  Fortis Investment Management N.V./S.A.
>  Brussels RPM/RPR 0462 748 891
>
> [email protected]
>  http://www.fortisinvestments.com
>
> This e-mail is confidential and may be privileged. If you have received it
> by mistake, please notify the sender by return e-mail and delete it from
> your system. You should not disclose, copy or use it for any purpose. The
> information in this e-mail is not contractual. Fortis Investments provides
> no guarantee as to the correctness of this information and accepts no
> responsibility for any action taken on the basis of it. Fortis Investments
> is the trade name for all entities within the Fortis Investment Management
> group.
>
>
>
> P Please consider the environment before printing this e-mail
>
>
>
>
> _______________________________________________
>  exslt mailing list
>  [email protected]
>  http://www.exslt.org/list
>