I’m experimenting with the ADxMenu - which seems to be pretty nice. The author includes all of the styles - including a special set of rules for IE - in the head of the document with style tags. I want to put all styles in their own stylesheets and link to them from the head of the main document. It was easy for most of it, but I wanted to use a conditional rule and put the IE styles in a separate IE stylesheet and there’s some stuff in there I don’t understand. Specifically, the code goes like this:
<!--[if lte IE 6]>
<style type="text/css" media="screen, tv, projection">
(then all the styles go in here)
I think I change the first part to something like:
/]]>/ (which, I assume, is the end tag for the CDATA)
Are you sure that works in Internet Explorer? IE can process HTML and so if that is actually valid HTML then IE should be able to process it correctly.
I haven’t tested, but I think that it works in IE9 preview, however.
If there is a context element, feed the parser just created the string corresponding to the start tag of that element, declaring all the namespace prefixes that are in scope on that element in the DOM, as well as declaring the default namespace (if any) that is in scope on that element in the DOM.
A namespace prefix is in scope if the DOM Core lookupNamespaceURI() method on the element would return a non-null value for that prefix.
The default namespace is the namespace for which the DOM Core isDefaultNamespace() method on the element would return true.
SVG elements don’t have an innerHTML property, so you can’t use it on SVG elements. However, you can use “<svg xmlns=’…” in innerHTML, which will create an SVG element.
Text. The thing about CDATA sections is that the ‘special’ characters in HTML lose their special meaning. For instance, characters like ‘<’ and ‘&’ can be used without escaping. That makes CDATA sections useful for showing examples of HTML or XML code, for instance.
<bar>An example of XML markup.</bar>
I’m glad that I have stumbled on this page. I have been trying to post question about this application. and i couldn’t get any answer to any one. I was searching the net until one of my friend told me about this cool site. Thank.
innerHTML implies the namespace declarations from the element you set it on (and its ancestors), although you can also set xmlns explicitly. createElement just uses the XHTML namespace.
Same as in XHTML – creates an element with the specified namespace.
I don’t follow. They work fine. createElement only handles one namespace, but that’s fine if it’s the namespace you want. The HTML DOM handles namespaces fine (you can create and insert an SVG fragment in an HTML document with createElementNS).
so how do you pecify the namespace you are referencing when using innerHTML or createElement with XHTML?
what does HTML do with the namespace when you use createElementNS?
In neither case does using those options with those markup languages make any sense. They may work in that they don’t crash but since they either don’t provide for entering all of the ingformation required or allow information to be specified that can’t be handled they do not work in any meaningful practical sense.
Also since HTML 5 is HTML only and doesn’t have an XHTML equivalent (since it isn’t SGML and therefore can’t be XML) those parts of the specification obviously need fixing before it will make any sense.
A CDATA-section is normally used for content that contains a lot of ‘special’ characters (like ‘<’ and ‘&’) that normally need to be escaped. Most browsers only support CDATA-sections for XML documents (including XHTML served as real XHTML, but not pretend-XHTML served as HTML). As far as I know, Opera is the only browser that supports CDATA-sections in HTML.
I don’t understand what “pretend XHTML” refers to. I’m using XHTML 1.0 Transitional - is that “pretend” because it’s not Strict?
Thanks for the explanations and yes - I’d like to use external js files as well. I’ve actually got two js files that are only needed by IE6. I’m still not clear how I put those in the conditional comments - with or without the CDATA part? So with the XHTML transitional doctype, is this right or do I need the CDATA stuff? And if I do, where does it go?
If you are using a MIME type of application/xhtml+xml then you are using real XHTML. If you are using a MIME type of text/html with an XHTML doctype then you are using HTML and pretending it is XHTML. The MIME type defines the type of document you are creating, not the doctype.
The easiest way to tell which you are using is to view the page in Internet Explorer. IE can’t handle XHTML and so if the page is served as real XHTML then it will offer the file for download instead of displaying it (at least in IE8 and earlier and Microsoft have not announced any intention of supporting XHTML in IE9 so it probably wont support it either)…