Hi
I was able to get a solution from sheela and replace the xml tag with html using the altchunk.
Here is the problem i face.
I have 3 tags. when i replace all the other tags get replaced with the first tag.
here is the piece of code.
any ideal why it is happening.
thx
egards
mahesh
NameTable nt = new NameTable();
XmlNamespaceManager nsManager = new XmlNamespaceManager(nt);
nsManager.AddNamespace("w", wordmlNamespace);
XmlElement node = xdoc.CreateElement("w:altChunk", wordmlNamespace);
XmlAttribute attr = node.Attributes.Append(xdoc.CreateAttribute("r:id", relationshipNamespace));
attr.Value = relid;
XmlNode targetNode = xdoc.SelectSingleNode("//w:customXml[@w:uri='http://tempuri.org/XMLSchema.xsd' and @w:element='"+tag+"']", nsManager);
// if that tag is present then replace it
if (targetNode != null ) {
targetNode.ReplaceChild(node, targetNode.LastChild);
}
// save the word document
xdoc.Save(mainpart);
dd.Save(altchunk.GetStream());
wordDoc.Close();