[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [xml-dev] Re: determining ID-ness in XML
This topic came up just this morning on the mozilla list
A real request for functionality from a real user:-)
Note the document _does_ reference the mathml dtd and the mathml dtd
does declare almost every element to have an id atribute of type ID
but the browser (for the reasons Roger gives below) doesn't read the dtd
so it doesn't really help.
Of course the functionality is there, re-declare in the internal subset,
but is this really the answer that we want to have to be telling users?
(Roger is the lead of the project to implement MathML in Mozilla.)
From: "Roger B. Sidje" <email@example.com>
Subject: Re: MathML and DOM
Date: Sat, 10 Nov 2001 10:25:51 +1000
Organization: Another Netscape Collabra Server User
To: Lutz Lenzen <firstname.lastname@example.org>
X-Mailing-List: <email@example.com> archive/latest/2074
Content-Type: text/plain; charset=us-ascii
Lutz Lenzen wrote:
> Example: I have 3x3-Matrix an want to change
> by a button-click one single entry of this matrix...(without the trick
> of just changing the hole matrix by taking a <div>-range.
It is a bit messy, but you need to try something like:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "mathml.dtd" [
<!ATTLIST mtd id ID #IMPLIED>
<!ATTLIST mi id ID #IMPLIED>
<!ATTLIST mrow id ID #IMPLIED>
i.e., explictly specify that you want an attribute named 'id' of type ID
('id' could be named something else) on those XML/XHTML/MathML tags that
you want to access with getElementById(). And from there on, proceed with DOM
functions as usual. That's one of the strange things of XML.
(Normally, the official MathML DTD defines 'id' like that for all MathML tags,
but so are other things, and when trying to load the official "XHTML plus MathML"
DTD, my computer freezes for a short while... And bug 44458 makes this worse if this
huge DTD has to be parsed (and re-parsed) when browsing. So "mathml.dtd" is just a
trimmed 64 KB list of entities from the original 384 KB "XHTML plus MathML" DTD.)
This message has been checked for all known viruses by Star Internet
delivered through the MessageLabs Virus Scanning Service. For further
information visit http://www.star.net.uk/stats.asp or alternatively call
Star Internet for details on the Virus Scanning Service.