[Mozile] XHTML withing non-XHTML elements
James A. Overton
james at overton.ca
Sun Oct 22 17:18:43 PDT 2006
The relevant methods are these:
mozile.rng.Schema.prototype._indexNode -- stores arrays of RNG nodes
(as they are parsed from the RNG file) into a _types object by their
type, and a _names object by type and name
mozile.event.handle -- calls lookupRNG on the current DOM node
mozile.edit.lookupRNG -- gets the node's name, calls getNodes to get
an array of matching RNG nodes, and returns the first element of the
array. (Will eventually be smarter.)
mozile.rng.Schema.prototype.getNodes -- takes the node type and name
and returns the array from _types or _names
So you need to make sure that the node name stored by _indexNode() is
the same one given to getNodes(). If we were just dealing with XML,
then there would be no lowercasing at all. But because we want to
deal with HTML, where the browser automatically uppercases tag names,
sometimes lookupRNG() will lowercase the node name before calling
getNodes().
So make sure the node names used in _indexNode() and the getNodes()
call in lookupRNG() match.
James
On 2006-Oct-22, at 2:41 PM, Reto Bachmann-Gmür wrote:
> rng.js never gets loaded, but I found the function in mozile.js and
> changed it there, however I'm not sure if this is the right place. My
> XHTML/XML document contains the element with the upper-case letter
> and I
> think this method id lowercasing the element from the rng, where is
> the
> lowercasing of the elment-names of the dom?
>
> reto
More information about the Mozile
mailing list