W3C home > Mailing lists > Public > public-rdf-in-xhtml-tf@w3.org > June 2003

Re: Validating XHTML with embedded RDF

From: Masayasu Ishikawa <mimasa@w3.org>
Date: Sat, 28 Jun 2003 03:45:14 +0900 (JST)
Message-Id: <20030628.034514.74742822.mimasa@w3.org>
To: me@aaronsw.com
Cc: public-rdf-in-xhtml-tf@w3.org

"Aaron Swartz" <me@aaronsw.com> wrote:

> Our priorities are:
>   1. Ease of use
>   2. Not breaking things
>   3. Ease of extraction
> Adding a script tag obviously helps 3 without hurting any of the others.

Unfortunately, no.  In HTML 4, the content model of the script element
was CDATA so what looked like a comment was not really treated as
a comment but just character data.  And CDATA content ends at
the first ETAGO ("</") delimiter followed by a name start character,
e.g. </License>, so it breaks validity at that point.

In XHTML the content model of the script element is #PCDATA, so a comment
is really a comment and adding <script>...</script> around it doesn't
really help.  Comments are not guaranteed to be passed to an application
from an XML processor.

If people really really want to embed RDF inside XHTML's body as data
AND still want to validate AND still don't want it to be rendered
right now, using CDATA section would be slightly less inelegant than
comments, something like:

  <div class="license">
    ... your RDF here ...

and add 

  div.license { display: none }

to your style sheet.  Unlike comments, contents of the CDATA section
are preserved and passed to an application, so while RDF is not treated
as markup (and thus won't affect DTD validation), applications could
reliably extract data inside CDATA section.  If folks really want to
hide RDF even if style sheet is disabled, well, then you could put
CDATA section inside the script element as a last resort.

I'm not really advocating this,	it's still a hack.  Just slightly
better than comments, if you really can't choose any other

Masayasu Ishikawa / mimasa@w3.org
W3C - World Wide Web Consortium
Received on Friday, 27 June 2003 14:45:16 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:01:42 UTC