Skip to main content
Inspiring
May 29, 2007 5:48 PM UTC
Question

XHTML Strict Validation - database

I accidentally posted in the general area.

I made the mistake of putting html in a database. It wasn't a problem
until I decided to go with strict XHTML in the database to format parts
of the text. Now, when I validate a site using w3c, I get tons of errors
on the page even though the page itself is actually fine. the content
that populates the page, messes it up.

I have a lot of "unclosed" tags, mostly "br"s

What would be the best way to fix this? Any ideas? By the way, there are
over 1500, entries that are wrong.
This topic is closed to new replies. Start a new post to keep the conversation going.

9 replies

Inspiring
May 30, 2007 9:29 PM UTC
Lee wrote:
> update Description set Paragraph=replace(Paragraph,'’', '''')
>
> This one it only gets caught up on the first set. It's seeing that 3rd
> single quote as extra.
Ended up using this

update Description set Paragraph = replace(Paragraph, char(153), '™')
Translate
Inspiring
May 30, 2007 5:32 PM UTC
update Description set Paragraph=replace(Paragraph,'’', '''')

This one it only gets caught up on the first set. It's seeing that 3rd
single quote as extra.
Translate
Inspiring
May 30, 2007 2:36 PM UTC
Julian Roberts wrote:
> You'd use the replace() function. eg
>
> update mytable set myfield=replace(myfield,'<br>','<br/>')
>
That worked!

However, I have a special single quote that I want to replace with a
regular single quote.

update Description set Paragraph=replace(Paragraph,'’', ''')
update Description set Paragraph=replace(Paragraph,'’', ''''')

The above errors out.
Translate
Inspiring
May 29, 2007 10:55 PM UTC
You'd use the replace() function. eg

update mytable set myfield=replace(myfield,'<br>','<br/>')

--
Jules
http://www.charon.co.uk/charoncart
Charon Cart 3
Shopping Cart Extension for Dreamweaver MX/MX 2004


"Lee" <lee_nospam_@artjunky.com> wrote in message
news:f3i06d$ia2$1@forums.macromedia.com...
>I have a number of ” these and I want to replace it with "
>
> What would the SQL look like?


Translate
Inspiring
May 29, 2007 8:07 PM UTC
Lionstone, you there?
Translate
Inspiring
May 29, 2007 7:57 PM UTC
SELECT *
FROM dbo.Description
WHERE (Paragraph LIKE '%”%')

What would I need to add to this so that it would replace all the
instances of ” with "

There may be multiples of ” in each row.
Translate
Inspiring
May 29, 2007 7:50 PM UTC
I have a number of ” these and I want to replace it with "

What would the SQL look like?
Translate
Inspiring
May 29, 2007 6:55 PM UTC
non SGML character number 148.

How would I search a database for this type of error?
Translate
Inspiring
May 29, 2007 5:56 PM UTC
You could do a find and replace in the database.

--
Jules
http://www.charon.co.uk/charoncart
Charon Cart 3
Shopping Cart Extension for Dreamweaver MX/MX 2004


Translate