The Browser War continued (4/6) - exploring XML | WebReference

The Browser War continued (4/6) - exploring XML

The Browser War continued: XML support in IE and Mozilla

The CSS2 solution for Mozilla

This whole book example was inspired by the Mozilla Amazon Search Example, so if you have a copy of Mozilla handy the link before brings you to a more flashy version of this example. IE5 users will only see a blank page because some of the CSS elements are not understood by this browser or can only be applied to HTML and not XML elements, or both. If you view the source you can at least see the raw XML. Not much of a help, though.

The CSS solution for Both Browsers

Simplifying the Mozilla examples yields some results in both browsers, by sticking to simple CSS1 elements:
Books {
  display: block;
}
Book {
  display: list-item;
  float: none;
  border: none;
  background: inherit;
}
Title {
  display: block;
  font-weight: bold;
  color: blue;
  text-decoration: underline;
  cursor: pointer;
}
Author {
  display: block;
  font-style: italic;
}
Synopsis {
  display: none;
}
ListPrice {
  display: none;
  text-align: right;
  padding-right: 15px;
  text-decoration: line-through;  
}
Price {
  display: block;
  color: rgb(20,100,0);
  font-weight: bold;
  text-align:left; 
}
ISBN {
  display: block;
  font-family: monospace;
  font-size: 8pt;
}
In this style sheet most elements are rendered as block items, the exceptions being Book which is a list item, and ListPrice and Synopsis which will be hidden from the viewer. Simple font attributes are applied to different book elements. See the output. Note that the links are not active in IE because it does not support X-Link. To make this work you would have to replace these links with HTML anchor elements already in the source.

next page

http://www.internet.com


Produced by Michael Claßen
All Rights Reserved. Legal Notices.

URL: http://www.webreference.com/xml/column4/4.html
Created: Jan. 17, 2000
Revised: Jan. 17, 2000