internal XMLCtor(XML xml, object tag, int id, int arity) : base(xml, tag, id, arity) { // private XMLLibImpl lib; // this.lib = xml.lib; this.options = xml.GetProcessor(); ActivatePrototypeMap(MAX_FUNCTION_ID); }
internal static Rhino.Xmlimpl.XmlNode NewElementWithText(XmlProcessor processor, Rhino.Xmlimpl.XmlNode reference, Rhino.Xmlimpl.XmlNode.QName qname, string value) { if (reference is XmlDocument) { throw new ArgumentException("Cannot use Document node as reference"); } XmlDocument document = null; if (reference != null) { document = reference.dom.OwnerDocument; } else { document = processor.NewDocument(); } System.Xml.XmlNode referenceDom = (reference != null) ? reference.dom : null; Rhino.Xmlimpl.XmlNode.Namespace ns = qname.GetNamespace(); XmlElement e = (ns == null || ns.GetUri().Length == 0) ? document.CreateElementNS(null, qname.GetLocalName()) : document.CreateElementNS(ns.GetUri(), qname.Qualify(referenceDom)); if (value != null) { e.AppendChild(document.CreateTextNode(value)); } return Rhino.Xmlimpl.XmlNode.CreateImpl(e); }
/// <exception cref="Org.Xml.Sax.SAXException"></exception> internal static Rhino.Xmlimpl.XmlNode CreateElement(XmlProcessor processor, string namespaceUri, string xml) { return CreateImpl(processor.ToXml(namespaceUri, xml)); }
internal static Rhino.Xmlimpl.XmlNode CreateText(XmlProcessor processor, string value) { return CreateImpl(processor.NewDocument().CreateTextNode(value)); }
internal virtual string EcmaToXMLString(XmlProcessor processor) { if (this.IsElementType()) { XmlElement copy = (XmlElement)this.dom.CloneNode(true); Rhino.Xmlimpl.XmlNode.Namespace[] inScope = this.GetInScopeNamespaces(); for (int i = 0; i < inScope.Length; i++) { DeclareNamespace(copy, inScope[i].GetPrefix(), inScope[i].GetUri()); } return processor.EcmaToXmlString(copy); } else { return processor.EcmaToXmlString(dom); } }
internal virtual string ToXmlString(XmlProcessor processor) { return processor.EcmaToXmlString(this.dom); }
internal virtual string Debug() { XmlProcessor raw = new XmlProcessor(); raw.SetIgnoreComments(false); raw.SetIgnoreProcessingInstructions(false); raw.SetIgnoreWhitespace(false); raw.SetPrettyPrinting(false); return raw.EcmaToXmlString(this.dom); }
internal static Rhino.Xmlimpl.XmlNode CreateEmpty(XmlProcessor processor) { return CreateText(processor, string.Empty); }