Havent figure this out yet but figure what I would post what I have so that others might get at least a little benefit.
It seems that a rich text box is a collection of HTML tags broken out in separate nodes within the namespace of the rich text box. I have been able to clone HTML tags and text that are ALREADY in the rich text box by doing something like this:
pn = XDocument.DOM.selectSingleNode("//dfs:myFields/my:Reporting/my:Summary_Methods")
pn.appendNode(pn.childNodes[0].cloneNode(true))
In this case, childnode 0 might be something like a bolded word followed by plain text that I typed manually in the IP form. Problem is I can copy a node but can only change its text and not the HTML tags that surround it. I was able to create a node from scratch with this:
xNode= XDocument.DOM.createNode(1, "strong","http://www.w3.org/1999/xhtm");
xNode.text = "X"
which ended up being a bolded "X" according to:
xNode.xml: "<strong xmlns="http://www.w3.org/1999/xhtm">X</strong>"
Great, I thought I had it until I realized I canNOT do an appendChild to stick xNode in pn as a child. It gives me an error saying that it is not in the expect format. Basically xNode is setting in limbo not really assigned to anything in the tree.
So does anyone know of a way to use the createNode method at the node where I need to add xNode? I cant simply do:
xNode = XDocument.DOM.selectSingleNode("//dfs:myFields/my:Reporting/my:Summary_Methods") .createNode(1, "strong","http://www.w3.org/1999/xhtm");
since the method is not support at that level.
I am about ready to give up but if anyone else knows of a way, please let me know. I cant believe it is this hard.
Thanks
Ernie