Click to See Complete Forum and Search --> : HTML and XML Help!!!!!!!!


wchl
May 7th, 2008, 01:35 PM
Hey everyone. I have been trying to find a solution for this but i can't find it anywhere.

In my C# Windows Applications, I am getting html text from a sql server database. I need to pass this html in an xml tag. But that isn't the problem. The person receiving the xml, wants the information in the html with all the formatting, but not the htlm tags that go with it.

For example.

What I get from database and put into BodyXML node:

<BodyXML><p>Hello,</p><p>I have a question bla bla bla</p><p>Any hints</p><p>Regards,</p><p>Klaus</p></BodyXML>

What the receiver of the XML wants in the BodyXML node:

<BodyXML>Hello,

I have a question bla bla bla

Any hintsRegards,

Klaus</BodyXML>

Basically, he wants an executed HTML with all the formatting in the xml node. how do i do this in C# before I assign it to the XML?

Right now I am just getting the HTML from the database and putting it in the XML node, HTML tags and all.

Any help would be great. thanks.

Arjay
May 7th, 2008, 02:02 PM
Basically, he wants an executed HTML with all the formatting in the xml node. how do i do this in C# before I assign it to the XML?Can you clarify whether you need formatting in the xml node? You state this but your example shows that all the html formatting is stripped out. If you need formatting, can you give an xml example of what you are looking for?

wchl
May 7th, 2008, 02:19 PM
Can you clarify whether you need formatting in the xml node? You state this but your example shows that all the html formatting is stripped out. If you need formatting, can you give an xml example of what you are looking for?


Hey Arjay. Thanks for the quick reply. Currently I am passing the HTML code with the tags and stuff. What they want is the executed HTML. As in the example without the html tags, there are spaces between each line because of the <p></p> tags.

basically, for example, if the html i get from the database is

Hello<BR>World

I need it to show in the BodyXML node:

Hello
World

with the <BR> executed

let me know, thanks

Arjay
May 7th, 2008, 02:26 PM
I would apply an xsl transform to the html before putting it into the xml node.

Of course the is imperfect because you are lose some of the formatting.

For example:

<B>Hello</B><BR>World

is going to show up as

Hello
World

not

Hello
World