W3C home > Mailing lists > Public > public-xml-processing-model-wg@w3.org > June 2011

XInclude and xml:id processing in Javascript

From: Alex Milowski <alex@milowski.org>
Date: Wed, 8 Jun 2011 19:23:54 +0100
Message-ID: <BANLkTik+OOosFipfsLj-F9_TQSndREa0Mg@mail.gmail.com>
To: XProc WG <public-xml-processing-model-wg@w3.org>
I've been experimenting with the implementation in Javascript issues
for both XInclude and xml:id.  I believe that one could make a useful
implementation that could quite possibly be compliant but it would
suffer from some issues:

  * The DOM mutation events aren't consistently supported by the major
browsers.  Specifically, because DOMAttrModified isn't support by any
WebKit based browser and that is unlikely to change in the future,
certain DOM operations would cause the xml:id implementation to be
unable to track changes in ID attributes.  A native implementation
would not suffer from this problem.

  * Fragment identifiers typically scroll the document but would
unlikely do so across browsers as expected.  This is because the
script runs after or during the document rendering and the initial
scroll has already been estimated.  A native xml:id implementation
would not have this issue and I've demonstrated that with the patches
I've made to WebKit to support xml:id.

  * baseURI fix-up for XInclude works well via the xml:base attribute
and so your browser must support that.

  * invocation: How does this all get invoked?  Magical extensions?
Script-tag inclusions?

I haven't completed my implementation and so I may have more before
tomorrow's call.

I did notice several other issues we should consider relating to
browsers and XML processing:

   * If a document is modified via a script, what is the expected
processing model?  For example, if I add an XInclude, is it automatic
that inclusion happens?


   * When content is included and xml:base attributes properly set the
base URI of an element, relative references in host markup languages
need take that post-processed base URI into account.  We should be
explicit about that somehow.  WebKit based browsers do not do this.
Firefox does.


We need to be explicit about the interaction between post-processed
infoset and the host application.

-- 
--Alex Milowski
"The excellence of grammar as a guide is proportional to the paucity of the
inflexions, i.e. to the degree of analysis effected by the language
considered."

Bertrand Russell in a footnote of Principles of Mathematics
Received on Wednesday, 8 June 2011 18:24:22 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 8 June 2011 18:24:22 GMT