private static NameTable GetNameTable(XmlContextBase parent) { return(parent.NameTable as NameTable ?? new NameTable()); }
protected XmlContextBase(XmlContextBase parent) : base(GetNameTable(parent)) { this.parent = parent; }
public void SetUp() { OriginalXml = GetXmlText(); Document = Xml(OriginalXml); OriginalXml = Document.OuterXml; Namespaces = new XmlContextBase(); Node = new SysXmlNode(Document.DocumentElement, typeof(object), Namespaces); Manager = new XmlReferenceManager(Node, DefaultXmlReferenceFormat.Instance); }
private static NameTable GetNameTable(XmlContextBase parent) { return parent.NameTable as NameTable ?? new NameTable(); }
#pragma warning restore 618 public void OneTimeSetUp() { if (IncludedTypes == null) { IncludedTypes = new MockXmlIncludedTypeMap(); IncludedTypes.DefaultClrType = TypeA.ClrType; IncludedTypes.InnerSet.Add(TypeA); IncludedTypes.InnerSet.Add(TypeB); } if (Context == null) { Context = new XmlContextBase(); Context.AddNamespace("p", "ns"); Context.AddVariable("test", "v", new MockXPathVariable("VariableValue")); Context.AddFunction("test", "f", new MockXPathFunction("FunctionValue")); } }