diff options
| -rw-r--r-- | src/feednim/atom.nim | 4 | ||||
| -rw-r--r-- | tests/test_atom.xml | 12 |
2 files changed, 7 insertions, 9 deletions
diff --git a/src/feednim/atom.nim b/src/feednim/atom.nim index 92e1060..3699e20 100644 --- a/src/feednim/atom.nim +++ b/src/feednim/atom.nim @@ -30,7 +30,7 @@ type AtomAuthor* = object name*: string # Required Atom field - url*: string + uri*: string email*: string AtomLink* = object @@ -79,7 +79,7 @@ proc parseAuthors ( node: XmlNode, mode="author") : seq[AtomAuthor] = for athr_node in node.findAll(mode): var author: AtomAuthor = AtomAuthor() author.name = athr_node.child("name").innerText - if athr_node.child("url") != nil: author.url = athr_node.child("url").innerText + if athr_node.child("uri") != nil: author.uri = athr_node.child("uri").innerText if athr_node.child("email") != nil: author.email = athr_node.child("email").innerText authors.add(author) diff --git a/tests/test_atom.xml b/tests/test_atom.xml index 5854868..64f443d 100644 --- a/tests/test_atom.xml +++ b/tests/test_atom.xml @@ -5,12 +5,12 @@ <updated>2003-12-13T18:30:02Z</updated> <author> <name>Joe Bloggs</name> - <url>http://joe.bloggs</url> + <uri>http://joe.bloggs</uri> <email>mail@joe.bloggs</email> </author> - <author> + <contributor> <name>Jane Bloggs</name> - </author> + </contributor> <category>Planes</category> <category>Trains</category> <category>Automobiles</category> @@ -71,12 +71,10 @@ <entry> <id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a</id> - <title>Aeroplanes not Airplanes</title> + <title>Trains Are Good</title> <updated>2003-12-13T18:30:02Z</updated> <author> - <name>Joe Bloggs</name> - <url>http://joe.bloggs</url> - <email>mail@joe.bloggs</email> + <name>Jane Bloggs</name> </author> <category>trains</category> <content src="http://trains.com"></content> |
