Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

XHTML Strict Validation - database

LEGEND ,
May 29, 2007 May 29, 2007
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.
TOPICS
Server side applications
417
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 29, 2007 May 29, 2007
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
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 29, 2007 May 29, 2007
non SGML character number 148.

How would I search a database for this type of error?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 29, 2007 May 29, 2007
I have a number of ” these and I want to replace it with "

What would the SQL look like?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 29, 2007 May 29, 2007
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
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 29, 2007 May 29, 2007
Lionstone, you there?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 29, 2007 May 29, 2007
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
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 30, 2007 May 30, 2007
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
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 30, 2007 May 30, 2007
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
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 30, 2007 May 30, 2007
LATEST
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), '&#8482;')
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines