Microsoft HomeproductssearchsupportshopWrite Us   Microsoft Home
Magazine
 |  Community
 |  Workshop
 |  Tools & Samples
 |  Training
 |  Site Info

Workshop  |  XML (Extensible Markup Language)

Direct Browsing of XML Files


Microsoft® Internet Explorer 5 Beta supports direct browsing of XML source files using XSL or cascading style sheets, just as users can browse HTML documents. For example, users can add XML files to their Favorites folder and can inspect XML files in the History list.

XML file authors specify the CSS or XSL style sheet to be used for displaying the XML file by using the notation described in the World Wide Web Consortium (W3C) note, http://www.w3.org/TR/NOTE-xml-stylesheetNon-MS link The XML file contains a processing instruction of the form:

<?xml:stylesheet type="typevalue" href="urlvalue"?>

The value of the type attribute can be set to the literal string "text/css" to select CSS processing, or "text/xsl" to select XSL processing.

For example, in the following fragment, the file "spec.xsl" is specified as the XSL style sheet:


<?xml version="1.0"?>
<?xml:stylesheet type="text/xsl" href="spec.xsl" ?>

When both CSS and XSL style-sheet processing instructions (PIs) are present, the XSL style sheet is selected. When multiple XSL style-sheet processing instructions are present, the first is selected and the others are ignored.

When no style sheet is specified in the XML source, the browser applies a default XSL style sheet to perform the transformation.

The browser displays informative error messages when errors occur. For example, Internet Explorer 5 Beta reports load errors (the XML source or XSL style sheet is not well-formed or not valid), XSL run-time errors, and security violations.

XSL Processing

The XSL style sheet must come from the same scheme (example: "http") and host name (example: www.microsoft.com) as the XML source. The XSL style-sheet download follows the same security policies as those for fetching an external entity. Attempting to read a style sheet from a different domain results in an access violation error.

When using an XSL style sheet, you can access the XML source through the XML Document Object Model (DOM). Two additional properties are exposed on the document object from DHTML: document.XMLDocument and document.XSLDocument. The XMLDocument property returns the root of the XML source tree, and the XSLDocument property returns the root of the XSL style sheet.

The XML DOM properties return IXMLDOMDocument (DOMDocument) objects. For more information about the XML DOM, see the XML DOM Reference.

For more information about XSL, see the XSL Reference.

CSS Processing

When CSS style-sheet and alternate style-sheet PIs are present, the behavior is the same as the HTML LINK element.

For more information about CSS, please see the CSS documentation.

When CSS processing is selected, the HTML namespace must be declared using xmlns:html="uri:html" on the root element of the XML file. Elements with the html prefix can then be treated as HTML elements.

Note that when using CSS style sheets, the implementation provided in this release imposes two restrictions on namespaces: All namespace declarations must be on the root element of the XML source file, and default namespace declarations (allowing use of the namespace elements without prefixes) are not supported.

Registration

When you install Microsoft Internet Explorer 5 Beta, its setup program performs all registration needed to support direct browsing of XML files. The XML source files have the MIME type "text/xml" or "application/xml", as described in the IETF RFC2376Non-MS link CSS style sheets have the MIME type "text/css", and XSL style sheets have the MIME type "text/xsl".


Does this content meet your programming needs? Write us!

Back to topBack to top

© 1998 Microsoft Corporation. All rights reserved. Terms of use.

 

Magazine Home
Ask Jane
DHTML Dude
Extreme XML
For Starters
More or Hess
Servin' It Up
Site Lights
Web Men Talking
Member Community Home
Benefits: Freebies & Discounts
Benefits: Promote Your Site
Benefits: Connect with Your Peers
Benefits at a Glance
Online Special-Interest Groups
Your Membership
SBN Stores
Join Now
Workshop Home
Essentials
Content & Component Delivery
Component Development
Data Access & Databases
Design
DHTML, HTML & CSS
Extensible Markup Language (XML)
Languages & Development Tools
Messaging & Collaboration
Networking, Protocols & Data Formats
Reusing Browser Technology
Security & Cryptography
Server Technologies
Streaming & Interactive Media
Web Content Management
Workshop Index
Tools & Samples Home
Tools
Samples, Headers, Libs
Images
Sounds
Style Sheets
Web Fonts
Training Home
SBN Live Seminars
SBN Live Chats
Courses
Peer Support
CD-ROM Training
Books & Training Kits
Certification
SBN Home
New to SBN?
What's New on SBN
Site Map
Site Search
Glossary
Write Us
About This Site