tags:

views:

36

answers:

1

From the MSDN documentation: This class implements the W3C Document Object Model (DOM) Level 1 Core and the Core DOM Level 2.

But AFAIK the W3C DOM Level 2 language bindings (IDL) define methods like getElementsByTagNameNS (which is missing for XmlDocument class in .NET).

Is .NET XmlDocument not implementing W3C DOM Level 2 (completely) or I am missing something? Do the methods need to be named like in the language bindings of the W3C?

Thanks!

+1  A: 

From the specification of WC3 DOM Level 2:

  • getElementsByTagName

    Returns a NodeList of all the Elements with a given tag name in the order in which they are encountered in a preorder traversal of the Document tree.

  • getElementsByTagNameNS (introduced in DOM Level 2)

    Returns a NodeList of all the Elements with a given local name and namespace URI in the order in which they are encountered in a preorder traversal of the Document tree.

In the XmlDocument these two different cases are handled using overloads:

XmlDocument.GetElementsByTagName(string name)

XmlDocument.GetElementsByTagName(string localName, string namespaceUri)

I'm not sure whether this qualifies as being compliant with the spec but it perfectly fits the capabilities of an object-orient language such as C#.

0xA3
Thanks for your answer.I am not sure if this "kind of implementation" fits the specification. Have the names of the methods to be same as in the spec (and the order of the parameters or the casing of the names)? Does anybody know this?Thanks for your help!
Runner