Embedding CSS style sheets in XML documents

According to http://www.w3.org/TR/xml-stylesheet/
instead of attaching external style sheets to XML documents
one can embedd style sheets in document itself

<cite>
Since the value of the href attribute is a URI reference, it may be
a
relative URI and it may contain a fragment identifier. In particular the
URI reference may contain only a fragment identifier. Such a URI reference
is a reference to a part of the document containing the xml-stylesheet
processing instruction (see [RFC2396]). The consequence is that the
xml-stylesheet processing instruction allows style sheets to be embedded
in the same document as the xml-stylesheet processing instruction.
</cite>

However it does not seem to work in any of current browsers and
CSS2.1 recommendation says nothing about this possibility.
It would be nice if someone could clarify whether browsers
should retrieve style sheets embedded in this way, and whether
it is possible to place CSS code in CDATA section, like
in the case of XHTML style container.

<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/css" href="#style"?>
<root>
<css xml:id="style">
root, element
	{display:block;}
element
	{color:green;}
css
	{display:none;}
</css>
<element>This text must be green</element>
</root>

Received on Thursday, 2 September 2004 10:55:54 UTC