Solved

call vbscript functions in xml or xsl

Posted on 2004-04-20
3
752 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
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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Extract data from xml in c# 8 59
Vb.net XML Read all nodes and 4 83
API Soap Calls 4 112
Fixing Non-Standard characters in text 8 103
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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. 
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

815 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

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now