Instance Walkthrough Asp+xml Programming (4)

Source: Internet
Author: User
V. Program homepage (default.asp)
?? Call the appropriate include file and public function, format the XML file, and display it. As you can see, the title of the page is customizable, and the public head and tail are made up of the corresponding include files. C_title, C_xmlfile, and c_xslfile are common constants, defined in constpub.asp files, and as far as their meaning is concerned, readers can easily understand them. This invokes the Formatxml function defined above.
<% Option Explicit
'***********************************************
' Description: Address Book
' Author: gwd 2002-11-05
'***********************************************
%>
!--#include file= "pub/funcxml.asp"-->
!--#include file= "pub/constpub.asp"-->
<HTML>
<HEAD>
<TITLE> <% = C_title%> </TITLE>
<meta http-equiv= "Content-type" content= "text/html;charset=gb2312"
<link rel= "stylesheet" href= "Contact.css" type= "Text/css"
</HEAD>
<BODY>
!--#include file= "pub/header.asp"-->
<% = Formatxml (C_xmlfile, C_xslfile)%>
<br>
!--#include file= "pub/footer.asp"-->
</BODY>
</HTML>

Vi. adding, modifying, and deleting information in XML
?? We know that the corresponding method has been defined in the Cls_person, so in each file, you just need to call the corresponding method. The file to add the information is add.asp, the file that modifies the information is edit.asp, the file that deletes the information is delete.asp, we only take add.asp file as an example to explain. The Checkstrinput and Checkstroutput functions are used to format the user's input and output strings.
<% Option Explicit
'***********************************************
' Description: 37080308 Address Book
' Author: gwd 2002-11-05
'***********************************************
%>
!--#include file= "pub/funcxml.asp"-->
!--#include file= "pub/constpub.asp"-->
!--#include file= "pub/funcpub.asp"-->
!--#include file= "pub/class/clsperson.asp"-->
<%
Dim Objxml, Objperson
Dim Strerr
Set objxml = Server.CreateObject ("MSXML2. DOMDocument ")
Set Objperson = New Cls_person ' generates Cls_person object

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.