EXSLT
<[email protected]> Tue, 18 Mar 2008 11:00:31 +0100
| Newsgroups | gmane.text.xml.xslt.extensions |
|---|---|
| Message-ID | <[email protected]> |
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