[whatwg] HTML: A DOM attribute that returns the language of a node

Ian Hickson ian at hixie.ch
Fri Jul 12 12:48:39 PDT 2013


On Wed, 24 Apr 2013, Peter Occil wrote:
> 
> Well in my case, I have written an HTML parser in Java and C# [1][2], 
> which parses HTML documents and returns an object that implements a 
> subset of the DOM, so far.  As far as possible, I included only methods 
> and attributes that were specified in the DOM or HTML specification, 
> such as the characterSet attribute (which is called getCharacterSet on 
> my DOM's IDocument interface), and more recently the innerHTML attribute 
> (which is called getInnerHTML on my DOM's IElement interface)
> 
> However, when I decided to implement an RDFa processor based on my HTML 
> parser, I had need to include a method that returns the language of a 
> node (see, for example, section 3.3 of reference [3]). As a result, I 
> included a method called getLanguage on my DOM's INode interface (which 
> may correspond to a possible--future--DOM attribute called "language" on 
> the Node interface).  I feel uneasy having to include this extension to 
> what ought to be a subset of the HTML DOM.

Implementations of HTML and the DOM are allowed to have internal methods 
to do things like this. There's no reason to limit yourself to the API 
visible to JavaScript.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'


More information about the whatwg mailing list