home *** CD-ROM | disk | FTP | other *** search
- <%@LANGUAGE="VBScript"%>
-
- <%
- Response.ContentType = "text/html"
-
- Sub ShowError(objDoc)
- 'create and display error message
- Dim strError
- strError = "Invalid XML file !<BR />" _
- & "File URL: " & objDoc.parseError.url & "<BR />" _
- & "Line No.: " & objDoc.parseError.line & "<BR />" _
- & "Character: " & objDoc.parseError.linepos & "<BR />" _
- & "File Position: " & objDoc.parseError.filepos & "<BR />" _
- & "Source Text: " & objDoc.parseError.srcText & "<BR />" _
- & "Error Code: " & objDoc.parseError.errorCode & "<BR />" _
- & "Description: " & objDoc.parseError.reason
- Response.Write strError
- End Sub
-
- Dim objXML
- Dim objXSL
-
- 'create two document instances
- Set objXML = Server.CreateObject("Microsoft.XMLDOM")
- Set objXSL = Server.CreateObject("Microsoft.XMLDOM")
-
- 'set the parser properties
- objXML.ValidateOnParse = True
- objXSL.ValidateOnParse = True
-
- 'load the source XML document and check for errors
- objXML.load Server.MapPath("emp_xml.xml")
- If objXML.parseError.errorCode <> 0 Then
- 'error found so show error message and stop
- ShowError objXML
- Response.End
- End If
-
- 'load the XSL stylesheet and check for errors
- objXSL.load Server.MapPath("emp_style.xsl")
- If objXSL.parseError.errorCode <> 0 Then
- 'error found so show error message and stop
- ShowError objXSL
- Response.End
- End If
-
- 'all must be OK, so perform transformation
- strResult = objXML.transformNode(objXSL)
-
- 'and insert the results into the page
- Response.Write strResult
- %>
-