Программирование в IIS


Пример 1.14


<%@ Language=VBScript %>

<%

'~~~~~~~~~~~~~~~~~~~~~~~~~~~

' Drawpage

' handles XML transformation

'~~~~~~~~~~~~~~~~~~~~~~~~~~~

sub Drawpage(sXML)

CONST XSL_FILE = "formatChair.xsl"

dim oXML

dim oXMLXSL

Set oXMLXSL = Server.CreateObject("Microsoft.XMLDOM")

Set oXML = Server.CreateObject("Microsoft.XMLDOM")

'load XML

oXML.loadXML(sXML)

'load the XSL

oXMLXSL.load(Server.MapPath(XSL_FILE))

'write the page

Response.Write(oXML.transformNode(oXMLXSL))

'destroy object

set oXML = nothing

set oXMLXSL = nothing

end sub

'~~~~~~~~~~~~~~~~~~~~~~~~~~~

' main

' dispatches calls

'~~~~~~~~~~~~~~~~~~~~~~~~~~~

sub Main()

dim o

dim XMLDOM

'create the object chair

set o = Server.CreateObject("ConfigSeat.clsChair")

'check for color setting

if len(Request("color"))>0 then

o.color = Request("color")

end if

'decide what to do

select case Request("Action")

case "New"

o.CreateChair

case "Open"

o.OpenChair Request("ID")

end select

'get the object state

set XMLDOM = o.GetChairState()

'write the page

Drawpage XMLDOM.XML

'destroy object

set o = nothing

set XMLDOM = nothing

end sub

'~~~~~~~~~~~~~~~~~~~~~~~~~~~

' Script entry point

'~~~~~~~~~~~~~~~~~~~~~~~~~~~

Main()

%>




- Начало -  - Назад -  - Вперед -