Malt.Reporting.OfficeXml.WordMLTemplate.ProcessReferenceTag C# (CSharp) Method

ProcessReferenceTag() private static method

private static ProcessReferenceTag ( XmlDocument xml, XmlElement placeholderElement, string value ) : void
xml System.Xml.XmlDocument
placeholderElement System.Xml.XmlElement
value string
return void
        private static void ProcessReferenceTag(
            XmlDocument xml, XmlElement placeholderElement, string value)
        {
            //这里我们强制替换成 w:t 元素,因为 Word2003 xml 不支持图片
            var refEle = new Xml.ReferenceElement(xml, value);
            var rEle = xml.CreateElement("w:r", WordMLNamespaceManager.WNamespace);
            var tEle = xml.CreateElement("w:t", WordMLNamespaceManager.WNamespace);
            rEle.AppendChild(tEle);
            tEle.AppendChild(refEle);
            placeholderElement.ParentNode.ReplaceChild(rEle, placeholderElement);
        }