Two servers using XML to connect data

Source: Internet
Author: User
Tags chr uuid xsl xslt access database
If you have two servers, you can exchange Access database data on both servers. Today, we made a remote interface to return the data in the MDB in XML form. The main idea is to populate the XML DOM with the Save method of the Recordset object, but this method produces XML that is not concise enough to produce XML that contains schema information that describes what nodes and attributes are allowed in the XML and what data types are used , and the data nodes also add namespaces. Schema information may be useful where data validation is required or more complex processing, but, in most cases, we are using thin clients and we do not need schema information. We can use XSLT to isolate the information we want, and remove the unwanted information.
The code is as follows:
<%
' Generate XSL Style
str = chr (&AMP;CHR) &AMP;CHR (9)
xslt= "<?xml version=" "1.0" "?>" & Chr (a) &AMP;CHR (Ten) & "<xsl:stylesheet version=" "1.0" "" _
& "Xmlns:xsl=" "Http://www.w3.org/1999/XSL/Transform" "" _
& "xmlns:s=" "uuid:bdc6e3f0-6da3-11d1-a2a3-00aa00c14882" "" _
& "xmlns:dt=" "uuid:c2f41010-65b3-11d1-a29f-00aa00c14882" "" _
& "xmlns:rs=" "Urn:schemas-microsoft-com:rowset" "" _
& "xmlns:z=" "#RowsetSchema" ">" & str_
& "<xsl:output omit-xml-declaration=" "Yes" "/>" &str_
& "<xsl:template match="/">" & STR&AMP;CHR (9) _
& "<xsl:element name=" "xml" ">" & STR&AMP;CHR (9) &AMP;CHR (9) _
& "<xsl:for-each select=" "/xml/rs:data/z:row" ">" & STR&AMP;CHR (9) &AMP;CHR (9) &AMP;CHR (9) _
& "<xsl:element name=" "Row" ">" & STR&AMP;CHR (9) &AMP;CHR (9) &AMP;CHR (9) &AMP;CHR (9) _
& "<xsl:for-each select=" "@*" ">" & STR&AMP;CHR (9) &AMP;CHR (9) &AMP;CHR (9) &AMP;CHR (9) &AMP;CHR (9) _
& "<xsl:element name=" "{Name ()}" ">" & STR&AMP;CHR (9) &AMP;CHR (9) &AMP;CHR (9) &AMP;CHR (9) &AMP;CHR (9) &AMP;CHR (9) _
& "<xsl:value-of select=" "." /> "& STR&AMP;CHR (9) &AMP;CHR (9) &AMP;CHR (9) &AMP;CHR (9) &AMP;CHR (9) _
& "</xsl:element>" & STR&AMP;CHR (9) &AMP;CHR (9) &AMP;CHR (9) &AMP;CHR (9) _
& "</xsl:for-each>" & STR&AMP;CHR (9) &AMP;CHR (9) &AMP;CHR (9) _
& "</xsl:element>" & STR&AMP;CHR (9) &AMP;CHR (9) _

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.