Solved

call vbscript functions in xml or xsl

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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

The Problem How to write an Xquery that works like a SQL outer join, providing placeholders for absent data on the outer side?  I give a bit more background at the end. The situation expressed as relational data Let’s work through this.  I’ve …
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.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

758 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

19 Experts available now in Live!

Get 1:1 Help Now