Are Css3 Namespaces Used For Anything Except Xml?
Solution 1:
Can anyone validate using it for CSS/HTML or clarify how you would do this?
Major browsers use a default namespace of http://www.w3.org/1999/xhtml
which is XHTML's namespace, even for HTML, and go about their business. Technically though, since HTML isn't XML, there isn't a point to this unless you consider that XML-based languages like SVG and MathML can be embedded within HTML anyway.
If your client wants to make use of CSS namespaces, they'll probably need to provide you with something that's written in a language that has some sort of namespacing mechanism that is compatible with CSS. It is meaningless to try and apply this knowledge to HTML itself because
- HTML wasn't exactly designed to be namespaced in the first place
- browsers already assign a default namespace to (X)HTML documents that you can't access explicitly anyway
More information can be found in this answer.
To answer your question title, the document language does not necessarily have to be XML-based:
Besides terms introduced by this specification, CSS Namespaces uses the terminology defined in Namespaces in XML 1.0. However, the syntax defined here is not restricted to representing XML element and attribute names and may represent other kinds of namespaces as defined by the host language.
The CSS Namespaces spec borrows terminology from XML Namespaces as a convenience simply because CSS is most commonly applied to HTML and XML documents (and even then, more people use XSL(T) with the latter instead).
Solution 2:
CSS namespaces are not about logically grouping CSS rules (a la namespaces in C++ and C#), but about applying rules as they apply to namespaced elements in a given host-language (in this case, XML documents with XML namespaces), but the specification is language-neutral so it could work with JSON (if someone invents namespaces for that) or any other structured language ( http://www.w3.org/TR/css3-namespace/ ).
2.1. Terminology
[..] However, the syntax defined here is not restricted to representing XML element and attribute names and may represent other kinds of namespaces as defined by the host language.
Solution 3:
The only other usage is with namespaced attributes and polyglot HTML5 (markup that can be rendered as both HTML and serialized XHTML). Here are some uses of CSS3 namespaces in the wild:
- XHTML5 + CSS Namespaces
- Report from the front: Epub3
- Some W3C Documents in EPub
- ePub Samples
- Polyglot ePub
- Mozilla HTML Stylesheet
- Mozilla MathML Stylesheet
- Mozilla SVG Stylesheet
- WebCore HTML Stylesheet
- WebCore MathML Stylesheet
- WebCore SVG Stylesheet
- Blink HTML Stylesheet
- Blink SVG Stylesheet
- Blink MathML Stylesheet
- Blink XHTML Mobile Profile Stylesheet
- Evolus Pencil Skin: Dialog Stylesheet
- Epub3 Samples: Children's Book Stylesheet
Post a Comment for "Are Css3 Namespaces Used For Anything Except Xml?"