Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

call vbscript functions in xml or xsl

Posted on 2004-04-20
3
Medium Priority
?
762 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 500 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

Application Discovery Service in AWS

In the era of the cloud, customers migrating away from their existing on-premise infrastructure. This requires lots of planning, strategies, and effort to identify their existing resources and determine how best to migrate.  Datacenter migrations happen in four phases -

Question has a verified solution.

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

Browsing the questions asked to the Experts of this forum, you will be amazed to see how many times people are headaching about monster regular expressions (regex) to select that specific part of some HTML or XML file they want to extract. The examp…
Many times as a report developer I've been asked to display normalized data such as three rows with values Jack, Joe, and Bob as a single comma-separated string such as 'Jack, Joe, Bob', and vice versa.  Here's how to do it. 
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

730 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