About 2 1/2 years ago my CRT monitor died (went up in a puff of smoke), and so I decided it was time to finally upgrade to a nice 19 inch LCD. Unfortunately, my video editing machine would no longer boot into windows 2000 (except safe mode), because the last g550 matrox driver release, for windows 2000, doesn’t support LCD monitors. Thus, my only option to get support was to upgrade to windows XP which I didn’t have the money to do.
So I figured I would research to see if GNU/Linux could be a viable video editing platform. But everything I read at the time said no. So I just let the machine sit there for the last two years. About a couple of weeks ago I finally decided to take the plunge and installed Ubuntu on it, so I could at least backup the data that was there and then start clean. Luckily in this time frame GNU/Linux has gain the ability to mount NTFS drives, so I didn’t have to reformat my drives and thus was able to use GNU/Linux to backup the data that was there.
While I was backing up my data I discovered a folder on one of the NTFS drives I had never seen before called “RECYLER”. So I started poking around in the newly discovered folder to see what was in there. And low and behold I found a gold mine. I found the master print of my Camp Attitude video (ogg) I did 5 years ago, which I thought I had forever lost due to me accidentally deleting the wrong file, and not noticing until a year later. I can’t tell you how jubilated I am, this is the find of the century, as I thought I would never be able to make a DVD of this video, so I can show the video to friends and family on a TV instead of a poorly encoded postage stamp QuickTime video on my computer. Which, up to this point was my last remaining copy. So in celebration I’ve made a copy of the master in ogg theora, so you can view the Camp Attitude video (in ogg), here on the website.
While debugging some code on a site I work on. I discovered a new double class bug in IE7. The weird thing about it is the code that causes the double class bug to appear is not even related to it. Sample Test case:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>IE7 Uncle Double Class Selector Bug</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<style type="text/css" media="screen">
p {
color: red;
}
.class1.class2 p {
color: green;
}
.foo + p { }
</style>
</head>
<body>
<div class="class1 class2">
<p>I’m Green</p>
<p>I’m Green Too</p>
</div>
<p>I’m red</p>
</body>
</html>
I’ve set all paragraphs to default to the color red. However, due to the double class selector changing its children’s paragraphs to green, and also creating a select any element that has the class foo, whose siblings are paragraphs (doesn’t matter if you set styles or not in that selector, or if the .foo is changed to * or to an element selector that is the same element as the parent with the double class selector [e.g. * + p {}, or div + {}]) it will cause IE7 to create a symbiotic relationship between “.class1.class2 p:last-child” and “.class1.class2 + p:first-of-type”. Thus, if you set styles on “.class1.class2 + p:first-of-type” it will cause “.class1.class2 p:last-child” to get those same styles (and visa versa). Luckily there are a couple work a rounds (ordered by effectiveness).
- Don’t use any sibling selectors in your styles
- Add any type of DOM node between .class1.class2 and it’s sibling p, so long as it’s not a plain text node (e.g. you can use a comment tag or empty element node with style set to display: none;).
- Add an inline style declaration on the effected element that overrides the style set on the “.class1.class2 p” selector.
- Change the “.class3 + p” selector to be an element + p selector, so long as the element to the left of the + is not the same element type that would get selected by the double class selector. In other words with the test case above you can use any element + p combination except for div + p
- Change the “.foo + p” selector to ” #foo + p” selector
- Change the double class selector to a single class selector (e.g. change “.class1.class2 p” to “.class2 p” or “.class1 p” (this solution only works so long as you don’t have any * + p selectors).
The question remains can the technique I showed in Fix for IE’s lack of application/xhtml+xml mean we can now embed other XML based formats inside the XHTML, as XML promises? The answer is, absolutely!
Here is a XHTML, SVG, MathML example page, that shows MathML and SVG embedded right along side an XHTML document. To properly view the page you will need to download these MathML Fonts, and these SVG and MathML plugins if viewing in IE.
What do we need to change to make this work?
- Modify the doctype to the XHTML file
- Modify the html tag to add the additional name-spaces
- Add object tags to head to inform IE to use plugins to render SVG/MathML
- Modify the xsl:stylesheet tag to include the additional name-spaces
Example of doctype, html and head tag modifcations
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="svgMathMlXhtml.xsl"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN"
"http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd"[
<!ENTITY % MATHML.prefixed "INCLUDE" >
<!ENTITY % MATHML.prefix "math" >
<!ENTITY % SVG.prefixed "INCLUDE" >
<!ENTITY % SVG.prefix "svg" >
]>
<html
xmlns="http://www.w3.org/1999/xhtml"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:math="http://www.w3.org/1998/Math/MathML"
xml:lang="en">
<head>
<title>Advanced Example</title>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
<object id="AdobeSVG" classid="clsid:78156a80-c6a1-4bbf-8e6a-3cd390eeb4e2"></object>
<?import namespace="svg" implementation="#AdobeSVG"?>
<object id="MathPlayer" classid="clsid:32F66A20-7614-11D4-BD11-00104BD3F987"></object>
<?import namespace="math" implementation="#MathPlayer"?>
</head>
Example of xsl:stylesheet modifications
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:math="http://www.w3.org/1998/Math/MathML"
xmlns:svg="http://www.w3.org/2000/svg"
version="1.0">
<xsl:output method="xml" encoding="utf-8"/>
<xsl:template match="/">
<xsl:copy-of select="node()"/>
</xsl:template>
</xsl:stylesheet>
Have you ever tried sending a 100% strictly compliant xhtml to IE, so that IE would use It’s xml engine to render the page? If so, you know that IE borks on it and forces you to download the xhtml file. I’m here to tell you that I’ve found a work around, that is standards compliant and gets around that limitation and forces IE to use the XML rendering engine. Two steps are required for it to work:
- Configure web server to send xhtml files with the mime type of application/xml
- Then attach a XSL sheet to each xhtml file you serve to IE
Exmple File
Example xhtml code
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="fixMe.xsl"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
<title>Simple Example < /title>
</head>
<body>
<!-- xhtml code here -->
<body>
</html>
Required fixMe.xsl code
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" version="1.0">
<xsl:output method="xml" encoding="utf-8"/>
<xsl:template match="/">
<xsl:copy-of select="node()"/>
</xsl:template>
</xsl:stylesheet>
Why does this work?
As far as IE is concerned you sent it a XML file, with an XSLT sheet applied to it. It’s XML rendering engine then applies the XSLT sheet which converts the XML page into an XHTML page. Without the XSLT sheet applied IE would have just showed us the source code to the page.
How did you ever figure this out?
I discovered this when I was developing this website, to teach myself XSLT. And knowing what I know about mime-types I figured it should work if I just changed the mime-type for XHTML from application/xhtml+xml to it’s alternate compliant mime-type of application/xml1, seeing as IE wasn’t having any issues displaying XML files sent as application/xml.
Additional Notes
Update: To see an example with SVG and MathML mixed in with the XHTML read So now that IE unerstands pure XHTML…
Here are a couple of links to parodies of the I’m a Mac I’m and I’m a PC Mac commercials:
- Video Parodies
- PC VS MAC VS Linux
If you haven’t yet seen the original Mac commercials, get off your lazy but and head over to the apple site and watch them.
Here’s to hoping that the music industry and Movie industry actually listen to Steve Job’s for a change:
Imagine a world where every online store sells DRM-free music encoded in open licensable formats. In such a world, any player can play music purchased from any store, and any store can sell music which is playable on all players. This is clearly the best alternative for consumers, and Apple would embrace it in a heartbeat. If the big four music companies would license Apple their music without the requirement that it be protected with a DRM, we would switch to selling only DRM-free music on our iTunes store. Every iPod ever made will play this DRM-free music.
Go to Steve’s blog to read more about Steve Job’s thoughts on DRM
It’s really sad that it’s true. But at the same time I can’t stop laughing. so without further adu: New Mac Commercial
It’s been a long and tough two years. But it has finally materialized. take your time and explore and see what you can find.
Due to the the kinds of things that will be discussed here I highly recomend downloading and installing one of these Hebrew fonts (listed in the order of our preference):
- SBL Hebrew
- Ezra SIL SR
- Ezra SIL
- The Cardo Font