BizTalk Utilities CV ,   Jobs ,   Code library  
 
 
Page 24 of 28

 

Previous Page Table Of Contents Next Page

XSLT Tutorial

XSLT: Putting it all together, server side code

To enable our code to run on all browsers we need to output HTML, instead of using client-side code.  Therefore we need to use ASP server-side code.

The following code demonstrates how to do this VBScript ASP code:

<%@ Language=VBScript %>
<HTML>
<HEAD>
</HEAD>
<BODY>
<P>

<%         
  set xmlDoc=server.createObject("Msxml2.FreeThreadedDOMDocument.3.0")
  set xslDoc=server.createObject("Msxml2.FreeThreadedDOMDocument.3.0")
  xmldoc.async = false
  xslDoc.async = false
  xmlDoc.load server.mapPath("/includes/myxml.xml")
  if (xmlDoc.parseError.errorCode <> 0) then 
    Response.Write "XML error - " & "<br>"
    Response.Write "Error Reason: " & xmlDoc.parseError.reason & "<br>"
    Response.Write "Source: " & xmlDoc.parseError.srcText & "<br>"
    Response.Write "Error Line: " & xmlDoc.parseError.line & "<br>"
    Response.Write "Error Position: " & xmlDoc.parseError.linepos & "<br>"
  end if

  xslDoc.load server.mapPath("allitems.xsl")
  if (xslDoc.parseError.errorCode <> 0) then 
    Response.Write "XSL error - " & "<br>"
    Response.Write "Error Reason: " & xslDoc.parseError.reason & "<br>"
    Response.Write "Source: " & xslDoc.parseError.srcText & "<br>"
    Response.Write "Error Line: " & xslDoc.parseError.line & "<br>"
    Response.Write "Error Position: " & xslDoc.parseError.linepos & "<br>"
  end if
  response.write xmlDoc.transformNode(xslDoc)
  set xmlDoc = nothing
  set xslDoc = nothing
%>
</P>
<P>&nbsp;</P>
</BODY>
</HTML>

 

Page 24 of 28

 

Previous Page Table Of Contents Next Page
 

Recent Jobs

Sr. Software Engineer - Analytics
Immediate Mainframe openings for Ch
Immediate TANDEM-TAL openings for C
Immediate ASP.NET/C# Openings for C
Sr. Software Engineer

View all Jobs (Add yours)
View all CV (Add yours)



spfxmasks
water softener
Teleconference
Host Department NOLIMIT Web Hosting
MSN
sunglasses
Cheap Web Hosting
conference calling


    Email TopXML  

Front Page Daily Stuff TopXML Forum XML blogs XML Newsgroups BizTalk Biztalk Utilities Biztalk Utilities Tutorial B2B SAP XML Microsoft .NET Dotnet System XML Soapformatter SQLXML XMLserializer XQuery PHP PHP SimpleXML PHP XML Dom PHP XML RPC PHP XSLT Java Java Java XML Xalan Microsoft ASP ASP Schemas XML SQL Server XML XMLDom XSL XSL Tutorial XSLT Stylesheets General Javascript CSS XHTML WAP