Browse DevX
Sign up for e-mail newsletters from DevX

Tip of the Day
Home » Tip Bank » XML
Language: XML
Expertise: Beginner
Oct 6, 1999



Building the Right Environment to Support AI, Machine Learning and Deep Learning

Apply an XSL Filter to an XML Document

I copied an XML document and an XSL document out of my XML for Dummies book. It said that to make the XSL document affect the XML document, I had to use a script and the object tag in HTML, and I had to get something from a CAB file from the Microsoft server. When I viewed the page it said "undefined." How can I apply an XSL document to an XML one?


There are a couple of different ways that you can "apply" an XSL document to an XML one, depending upon what you are trying to do. If you simply want the XML document to always use the XSL filter as a style sheet (somewhat analogous to CSS), then you can simply place a header for the XSL document as a namespace link:

However, one of the benefits for using XSL style sheets as independent entities is that you can apply different style sheets, depending upon the desired output. Using the MSXML DOM, you can accomplish this through the transformNode() function. In an IE5 Web page, you could output this as follows:

You should never explicitly need a CAB file when working with IE5 for the XML capabilities, as those files are already implicitly available in the IE5 download.

DevX Pro
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date