Embed XSL in Behaviors

Browsers Targeted: Internet Explorer 5

Behaviors let you create specific functionality within custom HTML tags. XSL (Extensible Stylesheet Language) lets you transform a block of XML into some form of output, including HTML. The two would seem to be ideally suited for one another, but hauling around an XSL file reference begins to weaken the power of such a combination. However, a nice feature of behaviors is that you can embed HTML within them, and more specifically, you can embed XML data islands inside of a behavior. Once embedded, you can retrieve the data island using its id property, then use XMLDocument to retrieve a reference to the XML document contained within.

For example, consider a behavior that takes a generic list of elements within a container element. The behavior will convert such a list into a selection list box, with the id of the container becoming the id of the

Share the Post:
Share on facebook
Share on twitter
Share on linkedin

Overview

Recent Articles: