3147Stream a Recordset to XMLhttp://www.4guysfromrolla.com/webtech/060601-1.shtmlDid you know that the ADO Recordset contains a Save method that can save the contents of a Recordset to an XML file? In fact, in an upcoming article on 4Guys this method will be discussed. One disadvantage of using this approach, though, is that the XML produced by the Recordset is anything but readable. Plus, there is a ton of information there, describing gobs of data for each column in the Recordset (its data type, precision, NULLability, maxlength, etc.). Additionally, when saving a Recordset to XML, the XML node names are archaic: each row's node name is z:row; the parent node is named rs:data.ASP > Tips and Tutorials > XML and ASPOct 10, 2006
This is the second article in my series about XML, XMLDom and ASP. For those who missed the first it?s avaible here
In my first article I showed how to parse an XML document using XMLDom and displaying the data. In this second tutorial I?ll show two different ways to retrieve an XML document from a remote server using ASP and ServerXMLHTTP.
XML is a great way to share information. However, if you want to be able to share it people will need to retrieve the data from you somehow (or you from them). For this purpose we have an object called XMLHTTP or, if used on a server, ServerXMLHTTP. Since both XMLDom and XMLHTTP are part of MSXML2 they can cooperate very nice. XMLDom can by auto use XMLHTTP to retrieve information and if you use XMLHTTP it can by auto return a XMLDom object with the retrieved XML data.
The easiest way to retrieve XML from an external site is to let the XMLDom handle it all. This requries the least amount of code and I would guess that it?s also a tiny bit more effective resource wise. Here is how to do it:
Pass-Guaranteed is your source for the Microsoft 70-225 exam. With our 70-225 Exam Resources, you can be rest assured that you will be fully prepared to take on your 70-225 Exam. Our Exams are written and formatted by Top senior IT Professionals working in today's prospering companies and data centers. All of our practice exams including the 70-225 exam will prepare you for success. 70-225 is a challenging exam, with our 70-225 study guide, you can feel safe with our question and answer explanations that will help you in obtaining your successful completion of your 70-225 exam.
By now, most of our readers are familiar, at least in principle, with XML - the w3c's platform neutral data markup language. However not everyone knows how to use XML with ASP. In this article, I'll run you through using ASP and JScript to open and read XML files. in the next article, I'll show you how to create and modify XML with ASP.
The example I'm going to show you is in use on my office intranet, for the purposes of identifying who is logged in. since all the machines in the office have a static, unique IP, I've used Request.ServerVariables("remote_host") to identify the machine, and XML to map machine to user. It's a little courtesy app, and also allows me to restrict administrative functions to only five machines in the entire office.
RSS files can be generated using Active Server Pages (ASP). It is OK for an RSS file to have a .asp suffix. In this example an RSS 0.91 file is generated, but it could easily be applied to other RSS versions. Similarly in this case the site stores its articles in a Microsoft Access database, but the database connection could be changed to reflect a Microsoft SQL Server database.
You can follow the example below or if you prefer you can download it in a text file here. You may get an XML error when you try and open the text file, just view source to get the code
With the advent of the Web, many organizations have put large amounts of information in the form of HTML pages. These pages are tied up to a single presentation. Extensible Markup Language (XML) allows us to separate the content and the presentation. If the developers think of a migration of these HTML pages to XML mechanically -- trying to create well-formed documents out of the existing HTML documents, or cutting and pasting contents from HTML to the newly created XML files, or whatever -- that would be a pretty daunting task. This article shows how the tool HTML Tidy and a COM Wrapper can make our job simpler. In my article Server side use of MSXMLDOM with HTML, I showed how we can exploit the functionality of the Document Object Model (DOM) parser to work with HTML documents, provided they are well-formed. This article is an extension of the same idea. Here we shall discuss a sample conversion of the bookmark file from HTML to XML and then into a browser-neutral tree view.
This article will be helpful for sites where a lot of information is maintained as flat HTML pages. All these site's pages share some kind of similar structure and the site developers think that the content should be separated from the publishing elements in order to support rendering media other than a browser or in order to have more control over the rendering itself
Joining mailing list will entitle you
to receive occasional emails informing you of news and
updates to the site and any special offers that may be
of interest to you.