internal void Initialize(XMLLibImpl lib, Scriptable scope, XMLObject prototype) { SetParentScope(scope); SetPrototype(prototype); prototypeFlag = (prototype == null); this.lib = lib; }
public static void Init(Context cx, Scriptable scope, bool @sealed) { Rhino.Xmlimpl.XMLLibImpl lib = new Rhino.Xmlimpl.XMLLibImpl(scope); XMLLib bound = lib.BindToScope(scope); if (bound == lib) { lib.ExportToScope(@sealed); } }
internal static Rhino.Xmlimpl.QName Create(XMLLibImpl lib, Scriptable scope, Rhino.Xmlimpl.QName prototype, Rhino.Xmlimpl.XmlNode.QName delegate_) { Rhino.Xmlimpl.QName rv = new Rhino.Xmlimpl.QName(); rv.lib = lib; rv.SetParentScope(scope); rv.prototype = prototype; rv.SetPrototype(prototype); rv.delegate_ = delegate_; return rv; }
protected internal XMLObjectImpl(XMLLibImpl lib, Scriptable scope, XMLObject prototype) { Initialize(lib, scope, prototype); }
internal XMLWithScope(XMLLibImpl lib, Scriptable parent, XMLObject prototype) : base(parent, prototype) { this.lib = lib; }
internal Rhino.Xmlimpl.QName CastToQName(XMLLibImpl lib, Context cx, object qnameValue) { if (qnameValue is Rhino.Xmlimpl.QName) { return (Rhino.Xmlimpl.QName)qnameValue; } return ConstructQName(lib, cx, qnameValue); }
internal Rhino.Xmlimpl.QName ConstructQName(XMLLibImpl lib, Context cx, object nameValue) { return ConstructQName(lib, cx, Undefined.instance, nameValue); }
// See ECMA357 13.3.2 internal Rhino.Xmlimpl.QName ConstructQName(XMLLibImpl lib, Context cx, object @namespace, object name) { string nameString = null; if (name is Rhino.Xmlimpl.QName) { if (@namespace == Undefined.instance) { return (Rhino.Xmlimpl.QName)name; } else { nameString = ((Rhino.Xmlimpl.QName)name).LocalName(); } } if (name == Undefined.instance) { nameString = string.Empty; } else { nameString = ScriptRuntime.ToString(name); } if (@namespace == Undefined.instance) { if ("*".Equals(nameString)) { @namespace = null; } else { @namespace = lib.GetDefaultNamespace(cx); } } Namespace namespaceNamespace = null; if (@namespace == null) { } else { // leave as null if (@namespace is Namespace) { namespaceNamespace = (Namespace)@namespace; } else { namespaceNamespace = lib.NewNamespace(ScriptRuntime.ToString(@namespace)); } } string q_localName = nameString; string q_uri; string q_prefix; if (@namespace == null) { q_uri = null; q_prefix = null; } else { // corresponds to undefined; see QName class q_uri = namespaceNamespace.Uri(); q_prefix = namespaceNamespace.Prefix(); } return NewQName(lib, q_uri, q_localName, q_prefix); }
internal Rhino.Xmlimpl.QName NewQName(XMLLibImpl lib, string q_uri, string q_localName, string q_prefix) { Rhino.Xmlimpl.QName prototype = this.prototype; if (prototype == null) { prototype = this; } Rhino.Xmlimpl.XmlNode.Namespace ns = null; if (q_prefix != null) { ns = Rhino.Xmlimpl.XmlNode.Namespace.Create(q_prefix, q_uri); } else { if (q_uri != null) { ns = Rhino.Xmlimpl.XmlNode.Namespace.Create(q_uri); } else { ns = null; } } if (q_localName != null && q_localName.Equals("*")) { q_localName = null; } return Create(lib, this.GetParentScope(), prototype, Rhino.Xmlimpl.XmlNode.QName.Create(ns, q_localName)); }
internal XML(XMLLibImpl lib, Scriptable scope, XMLObject prototype, Rhino.Xmlimpl.XmlNode node) : base(lib, scope, prototype) { Initialize(node); }
internal XMLList(XMLLibImpl lib, Scriptable scope, XMLObject prototype) : base(lib, scope, prototype) { _annos = new Rhino.Xmlimpl.XmlNode.InternalList(); }