This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

How to pass arguments to VBScript function in MS XML3



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 &gt; 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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]