.XHTML vs .Text

Last post 07-09-2004, 6:43 PM by Aluminum. 3 replies.
Sort Posts: Previous Next
  •  07-08-2004, 10:45 PM 1200

    .XHTML vs .Text

    Just looking for some high-level guidance or considerations on saving user input as XHTML or as Text. I'm developing a brand new ASP.NET Web application from scratch. Users will be allowed to create substantial portions of web pages - potentially making full use of most of the CuteEditor features. Any good arguments in favor of (or against) always saving user input as XHTML?

     
    Thanks.
  •  07-09-2004, 1:04 PM 1208 in reply to 1200

    Re: .XHTML vs .Text

      My two cents...I always give a user the ability to create HTML...but save both the HTML and plain text.

      I almost always end up having to create a search tool for user entered data! When creating abstracts for search results...you just simply cannot count on the returned HTML to be complete...which will cause malformed HTML content results. Using the plain text in your search abstracts prevents malformed HTML in your page displaying the search results...but when a user clicks on a returned link, you can now provide them with the full HTML content.
  •  07-09-2004, 6:41 PM 1209 in reply to 1208

    Re: .XHTML vs .Text

    I'm no expert, but here is my opinion:

     
    Whenever possible, force people to entered structured content via content templates (ie, forms).
     
    For instance, a job posting would have fields as such:
     
    title: ___________________
    classification: _______________
    pay rate: ______________
    dud date: _______________
     
    etc...

    Then, you'd format this yourself when you grab the data and build the HTML via the CMS.
     
    However, there are times when you need to allow people to enter free-form content.
     
    In that case, I'm trying to restrict the HTML editor to only allow the basic structured tags: Paragraphs, headers, lists,etc. I'm trying to avoid any presentational markup.
     
    And that is what we're storing in the database.
     
    Ideally, I suppose, you'd store XML mapped against a schema then transform that, but we're not that far yet ;o)
     
    I like Bruce D's suggestion about saving two versions. In my case, when I pull up content as a snippet/abstract I first remove all HTML tags via a regex leaving just the text.
  •  07-09-2004, 6:43 PM 1210 in reply to 1209

    Re: .XHTML vs .Text

    FYI, in all the research of CMS tools I did last year, my biggest gripe was that a lot of the systems lacked any method for structured content storage or the making of data-input templates. If they had one at all, it was jsut a 'press release' template. Everything else was free-form HTML content storage, which, to me, makes the tool more of a web site page editor than an actual content management system.
View as RSS news feed in XML