Use XSL to dynamically sort XML documents, pagination-displayed extensions

Source: Internet
Author: User
xml| Dynamic | pagination | sort | Show in http://www.asptoday.com/articles/20000724.htm there are very good examples that are about
Use XSL to dynamically sort XML documents, which are displayed in pagination.
Mainly uses three files:
Default.asp a string of XML and XSL files
Getxml.asp is equivalent to XML for default
Sample.xsl major formatting work here to do
===================================================
We can further expand this cool example:
1. Write the getxml.asp well. But our real job is not done in the ASP. We use VB.
In this way we can put this post a draft more to the VB forum.
Shaped like:
<%@ Language=vbscript%>
<script Language=vbscript runat=server>
Dim Omytool
Dim SXML
Set Omytool = Server.CreateObject ("Mypackage.mycomponent")
SXML = Omytool.getdata ()

Response.contenttype= "Text/xml"
Response.Write SXML

Set Omytool = Nothing
</SCRIPT>

2. In VB we use SQL 2000 for XML to get the required XML String.
Public Function GetData () as Variant

Dim oconn as ADODB. Connection
Dim Ocmd as Command
Dim ORS as ADODB. Recordset
Dim MyStream as ADODB. Stream
' Dim strconn as String
Dim Strxml as String

Set oconn = New ADODB. Connection
oConn.Open (getconnectionstring)

Set ocmd = New Adodb.command
Ocmd.activeconnection = oconn

Set MyStream = New ADODB. Stream
Mystream.open

Ocmd.properties ("Output Stream") = MyStream

Ocmd.commandtext = "Select EmployeeID, LastName, FirstName, birthdate, Notes" & _
"From Employees for XML Auto"

Ocmd.execute, adExecuteStream.
mystream.position = 0
Strxml = Mystream.readtext
Strxml = "<RET>" & Strxml & "</RET>"

GetData = Strxml

Set ocmd = Nothing
Oconn.close
Set oconn = Nothing

End Function
=============================
There are two points to note, one is SQL for XML Auto comparison soil, we need to add a root.
The second is that I use getconnectionstring to get SQL Conn STR because putting that STR
In the COM + construction string. So we can put this post in a draft for a little while.
COM Forums and multi-tier architecture forums, as well as security forums and, of course, SQL forums.

We just need to make a little change to sample.xsl to show our data.



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.