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

Since the value of the href attribute is a URI reference, it may be
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.

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"?>
<css xml:id="style">
root, element
<element>This text must be green</element>
Received on Thursday, 2 September 2004 10:55:54 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:27:15 UTC