[oXygen-user] Potential IE whitespace issue in Oxygen
Jesse Pelton
Wed Jan 13 11:48:09 CST 2010
It's not that IE doesn't play nice with XHTML, it's that IE does not
support XHTML at all.
Even if you serve a document that contains legal XHTML markup, user
agents will treat it as HTML if the content-type header is "text/html."
However, there are cases where legal XHTML is not legal HTML, which is
why the XHTML specification has an appendix of hacks to keep your XHTML
markup more or less understandable as HTML by browsers.
If you're serious about not supporting IE, consider setting the
content-type to "application/xhtml+xml" (or one of the related content
type values). This will cause user agents that support XHTML to process
your documents as such, while those that don't will not attempt to
display it. (IE displays it as XML or offers to download the resource
instead.) Then you won't have to worry whether your documents work as
HTML.
If abandoning IE turns out to be untenable, you could implement the
XHTML-to-HTML identity transform suggested by the W3C at
http://www.w3.org/MarkUp/2004/xhtml-faq#ie. That page says "Your XHTML
document will continue to work on browsers that accept XHTML," but it
doesn't say that it'll be treated as XHTML, so I'm not quite sure what
to expect.
-----Original Message-----
From:
[mailto:] On Behalf Of Steven
Ericsson-Zenith
Sent: Wednesday, January 13, 2010 11:02 AM
To: Dan Caprioara
Cc:
Subject: Re: [oXygen-user] Potential IE whitespace issue in Oxygen
Yes, thanks Dan, I had spotted this resource myself. While this will
fix the case for the script tag there are obviously other places that
it effects. By hand fixing the script tags in the code mentioned below
the page does render in IE, but the result is far from perfect since
other problems become manifest. I assume it's the same issue.
George's suggested solution will help. Incidentally, however, the
reformat in this case came from text mode and my auto-format
preferences set at George expects.
I really don't have a lot of time to waste on the issue and I am
resorting to the base assumption that no one I care about will be
using IE. In the meantime I'll make sure that I do a filesystem copy
of files I generate :-)
I should also note that things are complicated by the mime type
handling of IE. The bottomline appears to be that IE simply does not
play nice with XHTML.
With respect,
Steven
On Jan 13, 2010, at 4:39 AM, Dan Caprioara wrote:
> Hello Steven,
>
> You could try adding a space or a comment between the "script" tags.
> In this way the Author will preserve the two tags when saving the
> document.
>
> More reading about IE and XHTML whitespaces:
>
>
http://stackoverflow.com/questions/69913/why-dont-self-closing-script-ta
gs-work
>
> Many regards,
> Dan
>
>
>
> Steven Ericsson-Zenith wrote:
>> Dear George,
>> With this pointer from you, I seem to have identified the exact
>> problem. It has nothing to do with the introduction of binary
>> characters or the like.
>> Oxygen converts
>> <script .... ></script>
>> to
>> <script .... />
>> and this appears to be what causes the rendering engine in IE to
>> visit outer space. IE is obviously unaware that it does this and so
>> is happy to report no error whatsoever.
>> With respect,
>> Steven
>> --
>> Dr. Steven Ericsson-Zenith
>> Institute for Advanced Science & Engineering
>> http://iase.info
>> http://senses.info
>> On Jan 12, 2010, at 2:40 PM, George Cristian Bina wrote:
>>> Hi Steven,
>>>
>>> With the default settings and using the XML Accurate as algorithm
>>> I get 294 differences between the two files.
>>> Enabling the "Ignore whitespaces" option results in 10 differences.
>>> Enabling also "Ignore expansion state for empty elements" gets no
>>> differences.
>>>
>>> So, basically all the changes are in how empty elements are written.
>>>
>>> oXygen does not apply any formating if you open a file in the Text
>>> page, unless you turn on "Format and indent the document on open".
>>> However, if you open the document in Author mode then oXygen will
>>> parse the document on open and will serialize it on save, that
>>> causing a formatting to be applied according with the format and
>>> indent settings. I suppose that happened in your case.
>>> We are working to make the Author mode to keep the document part
>>> that was not changed as it was wrt formatting. Hopefully that will
>>> be available in the next maintenance release.
>>>
>>> Best Regards,
>>> George
>>> --
>>> George Cristian Bina
>>> <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
>>> http://www.oxygenxml.com
>>>
>>> Steven Ericsson-Zenith wrote:
>>>> Try
>>>> http://www.memeio.com/index.xhtml
>>>> and
>>>> http://www.memeio.com/saved-by-oxygen.xhtml
>>>> The Oxygen "compare files" notes no differences between these
>>>> files, yet one is rendered by IE and the other is not.
>>>> I develop on the Mac but if you load these files into Visual
>>>> Studio on a Windows machine you will discover the same effect,
>>>> one renders, the other does not. And if you really want to be
>>>> misled (or find the real problem) in Visual Studio: in the file
>>>> that does not render, delete the javascript imports from the
>>>> header one at a time starting with my code and then Yahoo's. The
>>>> page will render after you delete the YUI utilities.js import.
>>>> No problem is evident in any other browser and the issue appears
>>>> relevant to all versions of IE.
>>>> With respect,
>>>> Steven
>>>> --
>>>> Dr. Steven Ericsson-Zenith
>>>> Institute for Advanced Science & Engineering
>>>> http://iase.info
>>>> http://senses.info
>>>> On Jan 12, 2010, at 11:17 AM, Dan Caprioara wrote:
>>>>> Hello,
>>>>>
>>>>> This is an unusual situation.
>>>>>
>>>>> Please send us (support at oxygenxml.com) the original file and
>>>>> the one from the server.
>>>>>
>>>>> Many regards,
>>>>> Dan
>>>>>
>>>>> Steven Ericsson-Zenith wrote:
>>>>>> Dear George et al.,
>>>>>> I note a problem that cost me several hours of debugging.
>>>>>> If I generate a strict and validated xhtml file through Saxon
>>>>>> and then read it into the editor so that I can save it to a
>>>>>> URI, the file no longer renders in IE, though it is still
>>>>>> fine in other browsers. If I simply copy the file to it's
>>>>>> destination with a filesystem copy then it works fine in IE.
>>>>>> I am surprised that IE barfs on whitespace, but also concerned
>>>>>> that Oxygen adds something troublesome into the file. On a
>>>>>> brief inspection the problem seems to be both in the main
>>>>>> text (the header is where I traced an unexplainable issue to
>>>>>> using Visual Studio) and in the tail of the file, which
>>>>>> appears to have garbage attached.
>>>>>> With respect,
>>>>>> Steven
>>>>>> --
>>>>>> Dr. Steven Ericsson-Zenith
>>>>>> Institute for Advanced Science & Engineering
>>>>>> http://iase.info
>>>>>> http://senses.info
>>>>>> _______________________________________________
>>>>>> oXygen-user mailing list
>>>>>>
>>>>>> http://www.oxygenxml.com/mailman/listinfo/oxygen-user
>>>> _______________________________________________
>>>> oXygen-user mailing list
>>>>
>>>> http://www.oxygenxml.com/mailman/listinfo/oxygen-user
>> --
>> Dr. Steven Ericsson-Zenith
>> Institute for Advanced Science & Engineering
>> http://iase.info
>> http://senses.info
--
Dr. Steven Ericsson-Zenith
Institute for Advanced Science & Engineering
http://iase.info
http://senses.info
_______________________________________________
oXygen-user mailing list
http://www.oxygenxml.com/mailman/listinfo/oxygen-user
More information about the oXygen-user
mailing list