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

Re: [Fwd: ISSUE-63: White-Space Canonicalization of XML Literals]

From: Manu Sporny <msporny@digitalbazaar.com>
Date: Thu, 08 Nov 2007 23:57:47 -0500
Message-ID: <4733E8CB.1060008@digitalbazaar.com>
To: RDFa <public-rdf-in-xhtml-tf@w3.org>

Ben Adida wrote:
> Following up on my action to keep Ivan's points alive, I'm logging this
> issue. We should discuss ASAP.

Niklas recently raised some points [1] that were important to this issue:

> setting style="white-space: pre" on the h1 element makes
> innerHTML return a value with *most* space preserved.

I don't know if we want to modify the DOM just to get the XML Literal
out of it. That is an implementation detail of the DOM model that could
change in any version of IE.

In other words, we should look at the problem with the understanding
that we can always go from white-space preserved XML Literals to a
canonicalized form that does what XPath's normalize function does.

However, we cannot go the other way if the Firefox or IE folks decide to
change how the DOM stores spaces and newlines. If they decide to not
preserve whitespace anymore, a compliant RDFa parser will never be
possible in Javascript (unless we use the XMLHTTPRequest method you
previously mentioned).

The approach of using XMLHTTPRequest to get the document using either IE
or Firefox is a very neat approach to the problem, though. At first, I
thought that it would be a huge performance hit... however, I believe
XMLHTTPRequest uses the browser's cache, which should be populated
because the person is viewing the page that must be parsed by the
Javascript RDFa parser in the first place.

This makes using XMLHTTPRequest a very valid approach - we're guaranteed
that most (all?) browsers have some form of that Javascript object. We
know that the major browsers could definitely use this approach, the
RDFa parser could be run on the document gathered by using
XMLHTTPRequest and not the DOM.

This means that we can (and should, IMHO) preserve all of the formatting
in the original document for XML Literals.

Sorry for the previous post stating that we didn't have a choice, I had
not considered getting at the original document using XMLHTTPRequest.

-- manu


Manu Sporny
President/CEO - Digital Bazaar, Inc.
blog: Bitmunk Launches World's First Open Music Recommendation Service
Received on Friday, 9 November 2007 04:57:58 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:50:25 UTC