The xslt.asp Include File |
Search [jebjbhfj] |
||
Previous Next Xoc Software Training RVBA Conventions Maya Calendar Program Company Information Tools ASP.NET and Other Tips Articles Architecting, Writing, and Maintaining Large Programs in Visual Basic MiscellaneousConstructing a 404 Handler for IIS Constructing a Links Page using XML The default.asp File Differences between XHTML 1.0 and HTML 4.0The links.xml File The xslt.asp Include File The links.dtd File The links.xsl File The links.cdx File The cdf.xsl File ECMA, ISO, IETF RFCs, and Other Standards Home Automation Cataloging a Library Implementing a Privacy Policy Using P3P Mining Web Server Logs Object Oriented Programming Concepts Recommended Computer Books Recommended Internet Explorer Settings Review of the Compaq iPaq 3800 Series: H3830, H3835, H3850, H3870, H3875 Things to Consider when Internationalizing an Application Understanding the Internet Jigsaw Puzzle Using the Localization Toolkit Xoc Scale Search Engine Ratings Foldit Temporary Download Site Downloads Links Search Other Xoc managed sites: http://grr.xoc.net http://www.986faq.com http://www.mayainfo.org https://mayacalendar.xoc.net http://www.yachtslog.com |
<% Function CreateHTMLFromXMLXSL(strXmlDoc, strXslDoc, astrParamValue) 'Call this function using the following syntax: ' <!--#include virtual="xslt.asp"--> ' <[percent symbol] ' =CreateHTMLFromXMLXSL( _ ' Server.MapPath("filename.xml"), _ ' Server.MapPath("filename.xsl"), _ ' astrParamValue)) ' [percent symbol]> 'Where filename.xml and filename.xsl are replaced with 'the appropriate xml and xsl filenames, 'and [percent symbol] is replaced by a % 'astrParamValue is either Empty or 'it is an array of names and values of parameters Dim domXml Dim domStyle Dim nodParam Dim iastrParamValue set domXml = Server.CreateObject("msxml2.domdocument") domXml.async = False domXml.validateOnParse = False Call domXml.setProperty("SelectionLanguage", "XPath") Call domXml.setProperty("ServerHTTPRequest", 1) On Error Resume Next If domXml.load(strXmlDoc) Then Set domStyle = Server.CreateObject("msxml2.domdocument") domStyle.async = False domStyle.validateOnParse = False Call domStyle.setProperty("ServerHTTPRequest", 1) If domStyle.load(strXslDoc) Then Call domStyle.setProperty("SelectionLanguage", "XPath") Call domStyle.setProperty("SelectionNamespaces", "xmlns:xsl=""http://www.w3.org/1999/XSL/Transform""") If Not IsEmpty(astrParamValue) Then For iastrParamValue = LBound(astrParamValue) To UBound(astrParamValue) Step 2 Set nodParam = domStyle.selectSingleNode("/descendant::xsl:param[@name='" _ & astrParamValue(iastrParamValue) & "']") nodParam.Text = astrParamValue(iastrParamValue + 1) Next End If CreateHTMLFromXMLXSL = domXml.transformNode(domStyle.documentElement) Else CreateHTMLFromXMLXSL = XMLError(domStyle.parseError, strXSLDoc) End If Else CreateHTMLFromXMLXSL = XMLError(domXml.parseError, strXMLDoc) End If Set domStyle = Nothing Set domXml = Nothing End Function Function XMLError(parseError, strDoc) XMLError = "Error in line " & Clng(parseError.line) & " of " & strDoc & "<br />" _ & parseError.reason End Function %> |
||
Top |
[www.xoc.net] Copyright © 1997-2023 by Gregory Reddick . All Rights Reserved. 02/20/09 01:28 |