Skip to content

Commit

Permalink
Allow unknown types in OPML > 1.x, per:
Browse files Browse the repository at this point in the history
  • Loading branch information
rubys committed Jun 16, 2010
1 parent 0912c63 commit 3be35d3
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/feedvalidator/opml.py
Expand Up @@ -132,7 +132,12 @@ def validate(self):

else:

self.log(InvalidOutlineType({"parent":self.parent.name, "element":self.name, "value":self.attrs[(None,'type')]}))
opml = self.parent
while opml and opml.name != 'opml':
opml = opml.parent

if opml and opml.attrs.get((None,'version')).startswith('1.'):
self.log(InvalidOutlineType({"parent":self.parent.name, "element":self.name, "value":self.attrs[(None,'type')]}))

if (None,'version') in self.attrs.getNames():
if self.attrs[(None,'version')] not in opmlOutline.versionList:
Expand Down
15 changes: 15 additions & 0 deletions testcases/opml/clean/unknownOutlineType2.opml
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="ISO-8859-1"?>

<!--
Description: Unknown outline type
Expect: !InvalidOutlineType
-->

<opml version="2.0">
<head>
<title>Unknown outline type</title>
</head>
<body>
<outline text="Who's heard of this type?" type="oy-vey"/>
</body>
</opml>

0 comments on commit 3be35d3

Please sign in to comment.