W3C home > Mailing lists > Public > www-style@w3.org > September 2004

Embedding CSS style sheets in XML documents

From: George Chavchanidze <gch@rmi.acnet.ge>
Date: Thu, 2 Sep 2004 14:59:57 -0400 (GMT)
To: www-style@w3.org
Message-ID: <Pine.GSO.3.96.1040902144428.23910A-100000@rmi-sun.rmi.acnet.ge>

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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:32 GMT