codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:



Home » XML » Article

XML Ticker using XML Data Source Object (DSO)

Article by: Premshree Pillai (3/23/2003)
Bookmark us now! Add to Favourites
Email a friend!Tell a friend
Sponsored by: Neil Matthews Hypnotherapy, Wilmslow
Summary: This news ticker shows an example of data binding using the XML DSO which is an ActiveX control built into Microsoft Internet Explorer.
Viewed: 22475 times Rating (9 votes): 
 2.9 out of 5
 Rate this Article  Read Comments  Post Comments

XML Ticker using XML Data Source Object (DSO)



The above is a XML based JavaScript Ticker using the XML Data Source Object (DSO).

The above ticker shows an example of data binding using the XML DSO which is an ActiveX control built into Microsoft Internet Explorer.

To include this ActiveX control, you must use the tag with CLASSID as "clsid:550dda30-0541-11d2-9ca9-0060b0ec3d39".

Using the ticker is very simple. First you will need to place the style and script in the HEAD section of your page. Next, you will have to set the OBJECT tag with an ID of your choice (this must be unique) and initialise the script using the initTicker() function.

Here is the description of the arguments that the function initTicker() takes:

xmlFile : The XML file to read the ticker messages and URLs from.
objName : The ID of the OBJECT where you include the XML-DSO for that ticker.
counter : A counter that should be initialised to the max number of messages.
maxMsgs : The max number of messages in the data file.
timeOut : The delay (in milliseconds) between messages.

You can set more than one ticker on the page. For this make sure that when you set the tickers, their objName, counter, maxMsgs have different names.

To change the style of the ticker, make changes in the style section. No changes are needed in the script itself.

The Code

Begin by pasting the following into the head of your document

Select All Code


The style code for the ticker also goes in the head (of course you may make alterations here should you so desire):

Select All Code


Now in the place you want to place the ticker within the body, use the following:

Select All Code


Finally, here's what the XML file looks like, which is saved in the same directory and called ticker_items.xml

Select All Code





© 2003 Premshree Pillai.




CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums
Rate this article:     Poor Excellent
View highlighted Comments
User Comments on 'XML Ticker using XML Data Source Object (DSO)'


To post comments you need to become a member. If you are already a member, please log in .

 



RELATED ARTICLES
XML and JavaScript Tutorial
by Premshree Pillai
This tutorial shows how we can use XML and client side JavaScript. We will see how we can display the contents of a XML file using JavaScript, accessing child elements, manipulating elements etc.
Display XML in tree format using Javascript
by Premshree Pillai
In this article, I present a XML based client-side JavaScript that reads data from an external XML file, traverses the XML data and displays the same in a tree format. I'll use the XMLDOM ActiveX object built into Microsoft Internet Explorer for the same.
Pulling Data from Other Web pages with XMLHTTP
by Jeff Anderson
Using the little known (as yet) XMLHTTP object, part of the XML DOM Model, you can pull data from other web pages for manipulation or your own purposes.
Using the XML Data Source Object
by Premshree Pillai
The XML Data Source Object (DSO) is a Microsoft ActiveX control built into Microsoft Internet Explorer 4+. Using this object, it is possible to extract content from an external XML file or XML data embedded in the HTML file into a HTML page. In this article, I'll explain how to include the XML DSO, extract content from an external XML file, extract XML data from XML data embedded in the webpage and manipulation using JavaScript
XML Converter for MySQL database
by Rustem
MySQL has no native facilities for dealing with XML. This does not mean we are left out of the XML evolution. RustemSoft XML Converter has ‘MySQL to XML’ support.
Creating An XML Newsfeed
by Jeff Anderson
A full explanation of how to take an XML newsfeed from moreover, amazon affiliates, google or any of the other current feed providers, and turn it into a display page using a little ASP.
XML Ticker using XML Data Source Object (DSO)
by Premshree Pillai
This news ticker shows an example of data binding using the XML DSO which is an ActiveX control built into Microsoft Internet Explorer.
Amazon Lite Web Service
by kokogiak.com
A complete XML web service allowing you to offer complete Amazon searches and disaply results on your site. A fantastic introduction to XML Web Services.
XML Ticker
by Premshree Pillai
This is an XML based JavaScript Ticker that can tick any number of messages. The ticker works with IE only. The ticker reads it's contents, i.e the ticker style, text to be displayed, the link for that particular message from a XML file.
Batch processing XML with XSLT 2.0
by Krunal Patel
What you need is an XML version of the directory listing. Then, you could use that XML file as the single input file to XSLT and process each file using XSLT. It would be wonderful if you could do the directory processing in XSLT directly. Unfortunately, with all the power of XSLT -- and particularly XSLT 2.0 -- the language still doesn't have directory operations.








Recent Forum Threads
• Perl Unit Test Error
• execute a script in perl script
• Finding data in hash
• Re: finding the mismatches
• Time problem
• vector
• vector
• Math
• Re: Insert Contents of .txt file into a .html page


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2008