all groups > dotnet xml > december 2004 >
You're in the

dotnet xml

group:

ensuring html is valid before storing it


Re: ensuring html is valid before storing it Mujtaba Syed
12/30/2004 1:35:18 PM
dotnet xml:
The best way (and user-friendly too!) is to provide the user with an HTML
editor.

HTML is very lax and so everything goes. If you insist on users entering
markup, you may want to user XHTML 1.1 instead of HTML and validate the
input against
http://www.w3.org/TR/2001/PR-xhtml11-20010406/xhtml11_dtd.html#a_xhtml11_dtd

Hope this helps,
Mujtaba.

[quoted text, click to view]

Re: ensuring html is valid before storing it Christoph Schittko [MVP]
12/30/2004 6:09:07 PM
If the HTML that's imput is simple enough then you can write code to
walk the HTML DOM with Chris Lovett's SgmlReader [0]. That class will
also perform HTML to XHTML conversion [1].

HTH,
Christoph Schittko
MVP XML
http://weblogs.asp.net/cschittko


[0]
http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=B
90FDDCE-E60D-43F8-A5C4-C3BD760564BC
[1] http://eggheadcafe.com/articles/20030317.asp

[quoted text, click to view]

ensuring html is valid before storing it Peter Hardy
12/30/2004 6:28:14 PM
Hi guys,

Sorry for the cross-post but I got no response in the asp.net newsgroup.

I am trying to develop a mini e-learning application where the user provides
content for each page. Eventually, I'd like to shift to using templates but
at the moment the users is just entering content using html. Whats the best
way to allow the user to do this and whats the best way of ensuring the html
is valid before I store it in my database / xml document?

Cheers,

Peter Hardy

Re: ensuring html is valid before storing it Peter Hardy
1/2/2005 5:52:51 PM
Thanks for the advice guys. I bit the bullet in the end and bought the R.A.D
Editoe component whch allows users to create Xhtml. It's a very impressive
component and certainly worth a look.

Peter

[quoted text, click to view]

AddThis Social Bookmark Button