W3C home > Mailing lists > Public > www-dom@w3.org > January to March 1999

Re: xml for retrieving the values of HTML tags

From: Mike Champion <mike.champion@aliaron.com>
Date: Thu, 11 Feb 1999 11:26:17 -0600
Message-ID: <00c401be55e3$a4763520$54ac45d1@mcc.aliaron>
To: <f.cameron@ulst.ac.uk>, <www-dom@w3.org>

-----Original Message-----
From: Fiona Cameron <f.cameron@ulst.ac.uk>
To: www-dom@w3.org <www-dom@w3.org>
Date: Thursday, February 11, 1999 8:35 AM
Subject: xml for retrieving the values of HTML tags

>What I would like to do is use the XML DOM classes to do this more
>easily - for instance, get the value of the <title> tag.  Presumably
>this is what methods like getElementsByTagname do?  However, I
>cannot work out from the XML documentation how to get to the point
>where I can use this method - could anyone point me in the direction
>of some help?

getElementsByTagName could give you a collection of all "title" elements;
the value of any one of the title elements is formed by the set of child
nodes of that element.  In the simplest case, there is only a TextNode whose
value is the string you want, but if the title itself contains markup (such
as emphasis or entity references), you'll have to do some work to extract
the title as a simple string.

See some tutorial articles such as


I hope this helps,

Mike Champion
Received on Thursday, 11 February 1999 12:26:23 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 20 October 2015 10:46:05 UTC