Solved

call vbscript functions in xml or xsl

Posted on 2004-04-20
3
758 Views
Last Modified: 2011-09-20
Hi

How can i call a user vbscript functions(asp pages) from a xml/xsl files??
0
Comment
Question by:ybaron
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 10

Accepted Solution

by:
Yury_Delendik earned 125 total points
ID: 10868590
You can pass object as  parameter and use function from that object in xslt:

Class TestObj
   Public Function tt()
      tt ="test"
   End Function
End Class

....

   Set xsltemp.stylesheet = xsldoc.documentElement
   Set xslproc = xsltemp.createProcessor
   xmldoc.resolveExternals = false
   xmldoc.loadXML "<dummy>xml</dummy>"
   xslproc.input = xmldoc

   Dim t
   Set t = New TestObj

   xslproc.addObject t, "urn:my-object"
   xslproc.Transform
   MsgBox xslproc.output


XSLT file:

<?xml version="1.0" encoding="utf-8" ?>
<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:my="urn:my-object" exclude-result-prefixes="my">
  <xsl:template match="/">
     <t><xsl:value-of select="my:tt()" /></t>
  </xsl:template>
</xsl:stylesheet>


It outputs: <t>test</t>
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Client Need Led Us to RSS I recently had an investment company ask me how they might notify their constituents about their newsworthy publications.  Probably you would think "Facebook" or "Twitter" but this is an interesting client.  Their cons…
Create a Windows 10 custom Image with custom task bar and custom start menu using XML for deployment.
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question