internal virtual Rhino.Xmlimpl.XmlNode.Namespace[] GetNamespaceDeclarations() { // ECMA357 13.4.4.24 if (this.dom is XmlElement) { Rhino.Xmlimpl.XmlNode.Namespaces rv = new Rhino.Xmlimpl.XmlNode.Namespaces(); AddNamespaces(rv, (XmlElement)this.dom); return rv.GetNamespaces(); } else { return new Rhino.Xmlimpl.XmlNode.Namespace[0]; } }
private Rhino.Xmlimpl.XmlNode.Namespaces GetAllNamespaces() { Rhino.Xmlimpl.XmlNode.Namespaces rv = new Rhino.Xmlimpl.XmlNode.Namespaces(); System.Xml.XmlNode target = this.dom; if (target is XmlAttribute) { target = ((XmlAttribute)target).OwnerElement; } while (target != null) { if (target is XmlElement) { AddNamespaces(rv, (XmlElement)target); } target = target.ParentNode; } // Fallback in case no namespace was declared rv.Declare(Rhino.Xmlimpl.XmlNode.Namespace.Create(string.Empty, string.Empty)); return rv; }