This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
How to pass arguments to VBScript function in MS XML3
- To: xsl-list at mulberrytech dot com
- Subject: How to pass arguments to VBScript function in MS XML3
- From: sotiris at ctl dot com dot cy
- Date: Mon, 17 Jul 2000 12:10:47 +0300
- Reply-To: xsl-list at mulberrytech dot com
Hi,
In a stylesheet I am writing I need to convert a string by ensuring that
certain characters are protected as follows:
\ \\
` \Q
' \q
> \>
tab \t
I have written VBScript code within my stylesheet using the <msxsl:script>
function, to do the above, but I cannot pass the string argument to it.
The string argument will be the value of certain element or attribute nodes
on the XML tree being processed. A simplified version of the code I have
written looks like:
<msxsl:script language="VBScript" implements-prefix="plss">
function MFS(AString)
dim locstr, outstr, i
locstr = AString
outstr = ""
do while(true)
i = instr(locstr, "'")
if i > 0 then
OutStr = OutStr + left(locstr, i - 1) + "\q"
locstr = right(locstr, len(locstr) - i)
else
outstr = outstr + locstr
exit do
end if
loop
test = outstr
end function
</msxsl:script>
I know that I need to invoke this as follows:
<xsl:value-of select="plss:MFS(??????????)"/>
but how do I pass the value of an element or attribute node into the
VBScript function? Does anyone know?
Kind regards
Sotiris, CTL, Cyprus.
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list