Implementing XML document online editing with XSL and ASP

Source: Internet
Author: User
Tags object model xsl xsl file
A detailed example is presented to illustrate the method of editing XML document data online. Because Netscape has a weaker support for XML, data processing must be done on the server side to achieve Cross-platform data interchange. To edit an XML document, the first thing to do is to extract and display the data to the visitor, and XSL provides a good solution for us to display the XML file. The following example uses an XSL style sheet to display an XML document for editing by the user, and then submits the edited data to the server and updates the data on the server side. The ASP (Active Server Pages) is used here to accomplish our task.
First, load the XML document that we want to edit, and use the Microsoft Document Object model (Microsoft Xmldom object) and the Xsl,xml document to convert the content of the HTML file that can be displayed on the client server side. Let's look at the XML and XSL files we're using.
XML file: Userdata.xml
<?xml version= "1.0" encoding= "gb2312"?
!--edited with XMLSpy v2004 rel. 4 U (http://www.xmlspy.com) by Dicky (Apple's Eden)-->
<UserInfo>
<field id= "Name" taborder= "1"
<FieldValue> Dicky </FieldValue>
</Field>
<field id= "Sex" taborder= "2"
<FieldValue> Male </FieldValue>
</Field>
<field id= "Unitname" taborder= "3"
<FieldValue> Shanghai Ateam Company </FieldValue>
</Field>
<field id= "Address" taborder= "4"
<FieldValue> Shanghai,zhongshan West Road 1800#,room 26A </FieldValue>
</Field>
<field id= "Tel" taborder= "5"
<FieldValue> 13800138000 </FieldValue>
</Field>
<field id= "EMail" taborder= "6"
<FieldValue> AppleBBS@GMail.Com </FieldValue>
</Field>
</UserInfo>
XSL file: userdata.xsl
<?xml version= "1.0" encoding= "gb2312"?
!--edited with XMLSpy v2004 rel. 4 U (http://www.xmlspy.com) by Dicky (Apple's Eden)-->
<xsl:stylesheet xmlns:xsl= "Http://www.w3.org/TR/WD-xsl"
<xsl:template match= "/" >
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 "/>
<body>
<form method= "POST" action= "edituserdata.asp"
Related Article

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.