.


:




:

































 

 

 

 


Atom




(weblog) , CNN.com. (CNN.com), (Breaking News, U.S., World, Weather, Entertainment & Video News), ( 12:43 p.m. EDT, Sat May 16, 2009) . , (, , , ) URL.

Atom . CNN.com , , . .

Atom feed http://www.w3.org/2005/Atom.

<feed xmlns='http://www.w3.org/2005/Atom' ① xml:lang='en'> ②

① http://www.w3.org/2005/Atom - Atom

② xml:lang . xml:lang .

Atom :

<feed xmlns='http://www.w3.org/2005/Atom' xml:lang='en'> <title>dive into mark</title> ① <subtitle>currently between addictions</subtitle> ② <id>tag:diveintomark.org,2001-07-29:/</id> ③ <updated>2009-03-27T21:56:07Z</updated> ④ <link rel='alternate' type='text/html' href='http://diveintomark.org/'/> ⑤

① title 'dive into mark'.

② subtitle 'currently between addictions'.

③ . RFC 4151 .

④ 27 2009 21:56 GMT. updated - .

⑤ . link , : rel, type href. rel . rel='alternate' , . type='text/html' , HTML . , , href.

, dive into mark. http://diveintomark.org/ 27 2009.

XML , Atom - .

: . :

<entry> <author> ① <name>Mark</name> <uri>http://diveintomark.org/</uri> </author> <title>Dive into history, 2009 edition</title> ② <link rel='alternate' type='text/html' ③ href='http://diveintomark.org/archives/2009/03/27/dive-into-history-2009-edition'/> <id>tag:diveintomark.org,2009-03-27:/archives/20090327172042</id> ④ <updated>2009-03-27T21:56:07Z</updated> ⑤ <published>2009-03-27T17:20:42Z</published> <category scheme='http://diveintomark.org' term='diveintopython'/> ⑥ <category scheme='http://diveintomark.org' term='docbook'/> <category scheme='http://diveintomark.org' term='html'/> <summary type='html'>Putting an entire chapter on one page sounds ⑦ bloated, but consider this &amp;mdash; my longest chapter so far would be 75 printed pages, and it loads in under 5 seconds&amp;hellip; On dialup.</summary></entry> ⑧

① author , : (Mark), http://diveintomark.org/ ( , , , .)

② title Dive into history, 2009 edition.

③ , link HTML .

④ entry, , .

⑤ entry : .

⑥ entry category. diveintopython, docbook html.

⑦ summary . ( content .) summary Atom type='html' HTML. , HTML- &mdash; &hellip; , .

⑧ , , entry .

XML

Python XML c . DOM SAX, ElementTree.

>>> import xml.etree.ElementTree as etree ①>>> tree = etree.parse('examples/feed.xml') ②>>> root = tree.getroot() ③>>> root ④<Element {http://www.w3.org/2005/Atom}feed at cd1eb0>

① ElementTree Python, xml.etree.ElementTree.

② parse() ElementTree. . . , XML .

③ parse() , . tree . , getroot().

④ , http://www.w3.org/2005/Atom. root : XML - ( ). Atom, {http://www.w3.org/2005/Atom}feed.

ElementTree XML '{ } '. API ElementTree.

 





:


: 2016-11-18; !; : 488 |


:

:

.
==> ...

1974 - | 1853 -


© 2015-2024 lektsii.org - -

: 0.008 .