Validating xhtml problem with ezxml

Author Message

Paul Forsyth

Monday 13 October 2003 8:13:13 am

Im working through some xhtml errors found when running my site through:

http://validator.w3.org

and im down to just one error now on the front page. :)

I have an xml field containing a sentence with an apostrophe. The validator doesn't like the output and states this:

Line 178, column 163: non SGML character number 146 (explain...).

...rch solutions tailored to each client’s needs.

Although the apostrophe is displayed correctly in the browser i can't seem to get the validator to like it. My page settings seem fine, encoding is iso-8859-1, etc, and the xml within the db seems ok.

Any ideas?

Paul

Alex Jones

Monday 13 October 2003 8:23:19 am

I believe $#146; is not a standard code. I believe it should be ’

Alex

Alex
[ bald_technologist on the IRC channel (irc.freenode.net): #eZpublish ]

<i>When in doubt, clear the cache.</i>

Paul Forsyth

Monday 13 October 2003 8:29:17 am

From this page:

http://www.w3.org/MarkUp/html3/latin1.html

&39; seems right.

But, why is the ezxml producing this encoding in the first place?

paul

Alex Jones

Monday 13 October 2003 8:34:58 am

Yeah, &#39; should do the trick for a simple apostrophe. Out of curiosity, this isn't from text pasted from Word or the like, is it?

Alex

Alex
[ bald_technologist on the IRC channel (irc.freenode.net): #eZpublish ]

<i>When in doubt, clear the cache.</i>

Paul Forsyth

Monday 13 October 2003 8:40:30 am

Yes!

It was pasted in from a copy document i was given.... It was from openoffice but the original doc might have been word ;)

Excellent, i now get:

This Page Is Valid XHTML 1.0 Transitional!

on the validator :)

Out of curiosity is there a way to safely convert characters like this. Working from copy documents is sometimes the only way i can remain sane. Is it a matter of ensuring the original document is itself using the right encoding?

thanks, alex!

paul

Alex Jones

Monday 13 October 2003 8:43:02 am

I don't know of a sure-fire way to do this, though a new wash item might do the trick. When I am worried about weird MS Word issues and the like I will often cut and paste the text into a plain-text editor first which will usually convert everything.

Alex

Alex
[ bald_technologist on the IRC channel (irc.freenode.net): #eZpublish ]

<i>When in doubt, clear the cache.</i>

Alex Jones

Monday 13 October 2003 8:46:43 am

Something along the line of the Word Cleaner at Textism may prove useful as well: http://www.textism.com/resources/cleanwordhtml/

Alex

Alex
[ bald_technologist on the IRC channel (irc.freenode.net): #eZpublish ]

<i>When in doubt, clear the cache.</i>

Paul Forsyth

Monday 13 October 2003 8:58:33 am

thanks,

lesson learnt.... :)

paul

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 19:13:31
Script start
Timing: Jan 18 2025 19:13:31
Module start 'layout'
Timing: Jan 18 2025 19:13:31
Module start 'content'
Timing: Jan 18 2025 19:13:32
Module end 'content'
Timing: Jan 18 2025 19:13:32
Script end

Main resources:

Total runtime1.0100 sec
Peak memory usage4,096.0000 KB
Database Queries72

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0054 587.9375152.6250
Module start 'layout' 0.00540.0028 740.562539.4453
Module start 'content' 0.00821.0002 780.0078583.8516
Module end 'content' 1.00840.0016 1,363.859416.1563
Script end 1.0100  1,380.0156 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00310.3077160.0002
Check MTime0.00120.1200160.0001
Mysql Total
Database connection0.00070.064510.0007
Mysqli_queries0.940593.1175720.0131
Looping result0.00070.0723700.0000
Template Total0.980297.020.4901
Template load0.00180.179720.0009
Template processing0.978496.866620.4892
Template load and register function0.00020.021510.0002
states
state_id_array0.00090.092510.0009
state_identifier_array0.00200.201920.0010
Override
Cache load0.00160.1601470.0000
Sytem overhead
Fetch class attribute can translate value0.00060.059720.0003
Fetch class attribute name0.00100.097090.0001
XML
Image XML parsing0.00060.061620.0003
class_abstraction
Instantiating content class attribute0.00000.0032120.0000
General
dbfile0.00070.0674160.0000
String conversion0.00000.004240.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
8content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
8content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 22
 Number of unique templates used: 5

Time used to render debug report: 0.0001 secs