xhtml in infopath

N

njdude

I have to add rtf text data ( plain old rtf) into xhtml nodes in
infopath. I have posted before but the issue is different now. I
figure that it has to be xhtml. so what i did was converted the rtf to
html and then used html2xhtml.dll from MS and converted the html to
xhtml
so rtf string --> html string --> xhtml string.

Now the Q is how do i go and update the node with this xhtml string

I just tried to set the .text of the node with the string but it goes
ahead and just displays the xhtml as a string !
but then i just created an xml form and just cut and pasted the xhtml
in there. then it comes up with lot of errors related to DTD and some
other elements...
Any ideas ?
 
S

Shiva (GGK Tech)

Hi,

Usually we are set the value to node using .text property. You can try to
set the xhtml value as given steps below.

1. Get the xhtml string in one variable
2. Get the IXMLDOMNode using above xhtml string.
3. Try to append this node where do you want to set the value; you have to
delete the empty node before adding this node.

Get the IXMLDOMNode:

//This method prepares an XML node with the XML string passed.
public IXMLDOMNode GetNodeFromXmlString(string inputXml)
{
IXMLDOMDocument queryDoc = thisXDocument.CreateDOM();
queryDoc.validateOnParse = false;
queryDoc.loadXML(inputXml);
return queryDoc.documentElement;
}

Hope this helps you
 
N

njdude

Thanks for your response. i tried your suggestion. I used the
following xhtml

<html xmlns="http://www.w3.org/1999/xhtml" ><head><style type="text/
css">body {padding-left:90pt;width:612pt} p {margin-top:0pt;margin-
bottom:0pt}</style><title>Sadfasf</title></head>
<body><p><span style="font-size:26pt;">Sadfasf </span></p>
<p> </p>
<p> </p>
<p><span style="text-decoration:underline;font-size:
8pt;">sadfasdf </span></p>
</body></html>

but the output was very bad ! This was the output !

body {padding-left:90pt;width:612pt} p {margin-top:0pt;margin-bottom:
0pt}Sadfasf Sadfasf sadfasdf


i dont think it recognized any of the formatting. Am i doing something
wrong ?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top