Article ID: 273793 - Last Review: August 8, 2007 - Revision: 3.1 How To Include Client-Side Script Functions in an XSL DocumentThis article was previously published under Q273793 On This PageSUMMARY
When you return HTML from an XML/XSL transform, you often have to return SCRIPT blocks. For example:
NOTE: You only need the DEFER attribute when you manually perform the XML/XSL transform in client-side script. You do not need this attribute in a server-side XML transform, or if the transform is performed when navigating to a static XML file that links to the XSL document. MORE INFORMATION
If you do not include the DEFER attribute for the <SCRIPT> tag, and the function is called from the transformed document, an "Object Expected" error occurs. In addition, you must enclose the SCRIPT block in <xsl:comment> tags and a CDATA section. If you do not wrap the script in a CDATA section, the XML parser parses the contents of the SCRIPT block. Because script can contain reserved characters, such as "<" and ">", the CDATA section protects the parser from potentially invalid XML within the SCRIPT block. Sample CodeNOTE: Make sure that you save the following files in the same folder.
REFERENCES
For more information on the SCRIPT element, see the following Microsoft Developer Network (MSDN) Web site:
http://msdn.microsoft.com/workshop/author/dhtml/reference/objects/script.asp
(http://msdn.microsoft.com/workshop/author/dhtml/reference/objects/script.asp)
For more information about XML, see the XML Reference at the following MSDN Web site:
http://msdn.microsoft.com/library/psdk/xmlsdk/xml_9yg5.htm
(http://msdn.microsoft.com/library/psdk/xmlsdk/xml_9yg5.htm)
For more information about Microsoft Windows Script Technologies, see the following MSDN Web site:
http://msdn2.microsoft.com/en-us/library/ms950396.aspx
(http://msdn2.microsoft.com/en-us/library/ms950396.aspx)
For more information about developing Web-based solutions for Microsoft Internet Explorer, visit the following Microsoft Web sites:http://msdn.microsoft.com/ie/
(http://msdn.microsoft.com/ie/)
http://support.microsoft.com/iep (http://support.microsoft.com/iep) APPLIES TO
| Article Translations
|


Back to the top
