Re: RSS SQL tables



Jasen Betts wrote:

On 2009-04-14, croora <croora@xxxxxx> wrote:
Erwin Moller wrote:
croora schreef:
I like to store all RSS 2.0 elements in db with php. I try to design
optimal database structure.

Is there some recommended structure or something?

Well, common sense?
Define all the elements (attributes) you want to store.
Create a table that holds that information.
Use a serial (autonumber) primary key in that same table to identify
each record.

Regards,
Erwin Moller


tnx



i know that it looks simple, but it isn't :)

in RSS specification, some tags has own attributes and another nested
tags (etc. <enclosure> has attributes, <image> has 3 nested elements).

xml does not translate well to a relational database.

you might try something liek this.

CREATE TABLE xmlnode (
id serial PRIMARY KEY,
nodename TEXT,
parentnode integer references xmlnode(id) ON DELETE CASCADE,
textvalue TEXT
)

CREATE TABLE xmlattribute
{
node integer REFERENCES node(id) ON DELETE CASCADE,
attrnum INTGER,
attributename TEXT,
atrtribute TEXT,
PRIMARY KEY (node,attrnum)
}

but I can't see it being very useful.

why do you wish to represent the XML as relations, what sort of
manipulations do you plan to do on it using SQL?

I would be inclined to put entire articles into TEXT fields,

i try to store misc RSS feeds in database, manipulate them and then restore
RSS again (mysql+php).

does have sence doing something like that? or it is waist of time?

i don't know, maybe i return to one TEXT field and XML parser :(

tnx on any advice
.



Relevant Pages

  • Re: SQL SERVER
    ... It's not only an Explorer problem. ... number of files you need to store: it's the same problem in every file ... Here is sample you want for why storing XML in a database: ... XML column of the table the definition you want (it's not relational any ...
    (microsoft.public.sqlserver.msde)
  • Re: DataBase
    ... > You can use XML to store the data pretty easily. ... > with ADO.net you can import or export the data to XML. ... > Andrew J. Kelly SQL MVP ... >> database, but I need it not to use any SQl server. ...
    (microsoft.public.dotnet.languages.csharp)
  • XML in DataBase
    ... We need to store an entire XML document intact (not breaking the ... the SQL database to the file). ...
    (microsoft.public.sqlserver.xml)
  • Re: storing data in xml?
    ... >>I want to store a few informations the user entered on my website. ... >>However I don't want to use a MySQL database for this. ... > service, etc. then use XML. ... format for storage and retrieval. ...
    (alt.php)
  • Re: public and private mailboxes randomly dismounting
    ... When posting logs an important piece is the Event ID and Source. ... Information Store First Storage Group: An attempt to move the file ... An error occurred while writing to the database log file of storage group ...
    (microsoft.public.windows.server.sbs)