Scripting XML Elements

Internet Explorer provides limited support for scripting XML elements. For example, I can add an onclick event attribute to an XML element named <xlink> in an XHTML document. (We'll take a look at Xlinks and XHTML later in this book; see Chapters 15, 16, and 17.)

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet TYPE="text/css" href="xlink.css"?>

<!DOCTYPE html SYSTEM "t3.dtd">
<html>
    <head>
    </head>

    <body>
    Want to check out <xlink xml:link = "simple" inline="false"
    href = "http://www.w3c.org"
    onclick="location.href='http://www.w3c.org'">W3C</xlink>?
    </body>
</html>

I can specify in a style sheet, xlink.css, that <xlink> elements should be displayed in blue and underlined, as a hyperlink might appear, and I can ...

Get Inside XML now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.