Re: [xmlc] getElementsByTagName in XHTML ?
Petr Stehlik <[email protected]> Thu, 11 Aug 2005 23:27:30 +0200
| Newsgroups | gmane.comp.java.enhydra.xmlc |
|---|---|
| Message-ID | <[email protected]> |
This is a multi-part message in MIME format...
------------=_1123795689-24892-301
Content-Type: text/plain; charset=ISO-8859-2
Content-Transfer-Encoding: quoted-printable
Jacob Kjome p=ED=B9e v P=E1 05. 08. 2005 v 10:46 -0500:
> > node.getTagName() returns "td" because that node is of type
> > HTMLTableCellElement...
> You are using the HTML DOM or XHTML? From above, it looks like the HTML =
DOM as
> the XHTML DOM would be XHTMLTableCellElement, no? Typo?
I probably use HTML DOM but I compile source xhtml and get xhtml like
output :-) (that's due to IE's compatibility to real xhtml or something
like that).
> > Well, even if the getElementsByTagName was supposed to start from
> > children of the supplied node instead from the node itself then it still
> > doesn't work as I tested that case as well.
> What's the test case?
I don't have one. It just happened to me in my project and I had to
solve it immediately so I worked around it by implementing my own
function but I also thought it was worth to post about that issue to the
list. I helped to fix some bugs this way so I wanted to repeat it :-)
> If you were to do node.getElementsByTagName("td") and the
> current node is a "td", I wouldn't expect to have any results returned un=
less
> you were using nested tables.=20
well of course I did node.getParentNode().getElementsByTagName("td"). Or
actually I did search for some other elements, perhaps <input> or
something like that inside of <td>'s.
> If you are using the HTML DOM, that should be
> node.getElementsByTagName("TD") anyway, since the HTML DOM stores its nod=
es in
> upper case.
I tried both "td" and "TD", don't worry :-)
> > It's easy to write an implementation of getElementsByTagName that works
> > correctly and I am just doing that but I still wonder why the supplied
> > DOM method doesn't do what I'd expect.
> I wonder if your expectation is valid?
what's invalid on expecting the getElementsByTagName to return some
elements?
> I also wonder if your test is valid.=20
I can't be 100% sure that my test was valid but I wrote my own function
that does what I thought the getElementsByTagName would do - and it does
it well with the same input parameters.
> Can you provide the testcase you mention above so that we can verify whet=
her
> there really is something wrong here?
When I get some free time then perhaps yes. Sorry not now as I am too
busy with the project :-| BTW, the HTML was already changed and I don't
use the function anymore so creating a test case would require some
work.
Petr
------------=_1123795689-24892-301
Content-Type: text/plain; name="message-footer.txt"
Content-Disposition: inline; filename="message-footer.txt"
Content-Transfer-Encoding: 8bit
--
You receive this message as a subscriber of the [email protected] mailing list.
To unsubscribe: mailto:[email protected]
For general help: mailto:[email protected]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
------------=_1123795689-24892-301--