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);
}