[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Newbie needs help w/ proper display of XML w/ XSL+CSS in I

  • To: xml-dev@l...
  • Subject: Re: Newbie needs help w/ proper display of XML w/ XSL+CSS in IE6
  • From: "G. Ken Holman" <gkholman@C...>
  • Date: Sat, 22 Apr 2006 04:20:05 -0400

firefox xsl fo
At 2006-04-21 23:05 -0400, Karen Dec wrote:
>Hello out there...
>
>I am a newbie trying to learn how to use XSL and CSS to display my
>XML data.

XSLT and XPath questions would be better posted to the following list:

   http://www.mulberrytech.com/xsl/xsl-list

There are a number of subscribers who would enthusiastically respond 
to such questions.

There is also an *excellent* XSLT FAQ at:

   http://www.dpawson.co.uk

>I've created a display page for my collection of Amy Grant
>CDs just as something silly to practice on!

Not at all!  It works well to learn something new by using data you 
are familiar with.

>It displays exactly how I want it to in Firefox. However, in IE 6 I
>have a couple problems (surprise, surprise, right?):

Probably for you ... it is your data you are sending to the browser 
that is bad.  Firefox is masking your bad data while IE is exposing 
it.  I'm of the opinion masking bad data is harmful because you don't 
know you are doing anything wrong.  By exposing the bad data in IE 
you have the opportunity to fix the bad data.  Had you "gone into 
production" using only the Firefox rendering, you would have assumed 
you had good data and not realized your transform was creating garbage.

>1. IE 6 displays all my XML data in text format at the top of the
>page BEFORE displaying the XSL transformed version. What is causing
>this?

You are asking it to be displayed in text format, and IE happens to 
be exposing it while Firefox is suppressing it.

>It does not happen in Firefox.

It is happening in Firefox, it is just being suppressed at rendering 
time ... the page you are creating is in error and the two browsers 
are handling the bad data differently.

>2. IE 6 completely ignores the <caption> at the top of the table,
>which displays correctly in Firefox.

I created your files locally from your post and I see the caption in 
both IE and Firefox.  I cannot think of why it would be missing in 
your IE rendering.

>If anyone has any ideas that could help me with these problems, I
>would greatly appreciate it... I'm sure it's probably some simple
>thing to most of you out there...

Indeed ... you are pushing the root node through the built-in 
template rules, thus producing the text.

Saxon also produces the text.  I suspect that Firefox is too.

Note, however, that all that excess text shows up *before* the <html> 
document element, so the IE browser logic is rendering the excess 
text and the Firefox browser is suppressing it.

But just because you don't see the text in Firefox doesn't make the 
page correct, an HTML page is supposed to start with the HTML 
document element, and the result of your transform does not.

>Here is my XSL code in its entirety:

Thank you for supplying that to work with on the mail list to help you.

><?xml version="1.0" encoding="UTF-8"?>
><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/ 
>Transform">
><xsl:template match="/">
>    <xsl:apply-templates/>

Right there!  Before the HTML document element you are pushing the 
root node through the built-in template rules (because you do not 
have any other template rules in your stylesheet).  Take that line 
out and the excess text will no longer be in your HTML file, and then 
IE will no longer display it.

The differences on the canvas you see are the two browsers' different 
interpretations of invalid data.  Just because you don't see it in 
Firefox doesn't mean the data is correct.

I hope you find this helpful.

. . . . . . . . . . . . Ken

--
Registration open for XSLT/XSL-FO training: Wash.,DC 2006-06-12/16
Also for XSLT/XSL-FO training:    Minneapolis, MN 2006-07-31/08-04
Also for XML/XSLT/XSL-FO training:Birmingham,England 2006-05-22/25
Also for XSLT/XSL-FO training:    Copenhagen,Denmark 2006-05-08/11
World-wide on-site corporate, govt. & user group XML/XSL training.
G. Ken Holman                 mailto:gkholman@C...
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/x/
Box 266, Kars, Ontario CANADA K0A-2E0    +1(613)489-0999 (F:-0995)
Male Cancer Awareness Aug'05  http://www.CraneSoftwrights.com/x/bc
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.