News archiving

Anderson Lizardo andersonlizardo at yahoo.com.br
Fri Aug 22 20:05:07 PDT 2003


Jeremy Utley wrote:
> The archiving aspect is easy enough.  ALL news submissions will be in
> this XML file.  The default is last 5 entries - simply pull the last
> 5 entries from the XML file.  Want 20?  Pull 20 entries.  Quite
> simple, no backend stuff necessary, except some language to parse it.

I will resume your suggestion, and you correct me if I'm wrong 
somewhere:

- create a "newsml" containing news items[1];
- write a Perl script that parses this file, outputs a XHTML file 
containing the last 5 news and archives the rest.

This method has at least one issue: the field containing the news item 
content (<description>...</description>, in case of RSS), will have to 
be all entity-encoded. Eg: to output

<p>Paragraph 1</p>
<p>Paragraph 2</p>

the news writer will have to write

<description>
<p>Paragraph 1</p>
<p>Paragraph 2</p>
</description>

This is not a problem if you are using a XML editor.

[1] This could be in RSS format; see 
http://blogs.law.harvard.edu/tech/rss
-- 
Anderson Lizardo


_______________________________________________________________________
Desafio AntiZona: participe do jogo de perguntas e respostas que vai
dar um Renault Clio, computadores, câmeras digitais, videogames e muito
mais! www.cade.com.br/antizona



More information about the website mailing list