Mozilla.com

  1. element.getElementsByTagNameNS
Table of contents
No headers

I think it should be pointed out more precisely in documentation that the first parameter of getElementsByTagNameNS is the namespaceURI, and not the namespace as some people may think it.

Given an XML declaration <?xml xmlns:mynamespace="http://mynamespace.org/" encoding="utf-8"?> and a node named <mynamespace:mytag />

Use getElementsByTagNameNS('http://mynamespace.org/', 'mytag') to get such tags AND NOT getElementsByTagNameNS('mynamespace', 'mytag')

I don't know why you think it is unclear. The explanation for the namespace parameter states quite clearly that it is the URI of the namespace you have to pass.
BTW: what you mean with "mynamespace" in your example above is not the namespace, it is the so called namespace prefix! --Andreas Wuest 09:47, 15 December 2006 (PST)

Page last modified 17:47, 15 Dec 2006 by Andreas Wuest

Tags:

Files (0)