Re: Silva 1.o / Unicode problem

Bas Leeflang <[email protected]>
Newsgroups gmane.comp.web.zope.silva.devel
Organization Bijvoet Center
Message-ID <[email protected]>
Hi Guido,

I worked around the problem initially by replacing the '&' by the word 
'and'. I just converted it back. So have a look at:

http://www.bijvoet-center.nl/about/

When I inspect the source it seems that Silva is working fine in 
converting '&' to '&amp;' The problem actually occurs in the navigation 
tree structure on the left side of the page. This is a constructed in a 
python script that includes the title. 

    title = item.get_title()
    if item.get_short_title() == item.get_title():
        item_id = item.getId()
    else:
        item_id = item.get_short_title()
       
    url    = item.absolute_url()

This is the relevant section from the script where I use 'get_title()'. 
Furthermore the 'item_id' (displayed in the tree structure) is either 
the object ID or its SHORT-title.
Anyway..... What should I use to get a html-correct string?


Bas

Guido Wesdorp wrote:

> Bas Leeflang wrote:
>
>> I had another, related problem. When I include '&' in e.g. a title or 
>> even in the running text (all based on Silva). The final page just 
>> looks fine. However, when I try to validate such a page with the 
>> http://validator.w3.org/ xhtml validator I get error messages on the 
>> '&'. It should be escaped and not appear as plain text. At least that 
>> is what I recall from the error message.
>>
>> Should Silva take care about this, or is the validator not good 
>> enough in this respect?
>>
> If the public page contains a non-entitized ampersand sign, it's a 
> bug, ampersand signs should *always* be converted to an entity, they 
> should never end up in the HTML unentitized. If it does, browsers will 
> probably show the page correctly but the content is not well-formed 
> XML anymore. If that does indeed happen, the validator is right. 
> However, when I view a public Silva page I see the ampersand as an 
> entity, in the title, the breadcrumb trail, etc. so it sounds like 
> it's a problem with your custom template rather then a Silva bug.
>
> Could you give me the URL that you validated so I can take a look for 
> myself?
>
> Cheers,
>
> Guido
>

-- 
Dr. Bas R. Leeflang
Bijvoet Center for Biomolecular Research Tel : +31.30.253.3498
Utrecht University                       Fax : +31.30.254.0980
Padualaan 8, NL-3584 CH  Utrecht         Email: [email protected]
The Netherlands                          http://www.bijvoet-center.nl
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.