summaryrefslogtreecommitdiff
path: root/src/lxml/ElementInclude.py
diff options
context:
space:
mode:
authorscoder <none@none>2006-12-04 10:20:37 +0100
committerscoder <none@none>2006-12-04 10:20:37 +0100
commit25fce1f468f5265c904b078b75c3b45f190c3939 (patch)
tree6c5bc84c286d18dd40d98f289b88543068f69320 /src/lxml/ElementInclude.py
parent5b54e9465117f17b80953d261223445a2122edf1 (diff)
downloadpython-lxml-25fce1f468f5265c904b078b75c3b45f190c3939.tar.gz
[svn r2086] small fix to actually check if xi:fallback tag is misplaced before complaining
--HG-- branch : trunk
Diffstat (limited to 'src/lxml/ElementInclude.py')
-rw-r--r--src/lxml/ElementInclude.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/lxml/ElementInclude.py b/src/lxml/ElementInclude.py
index 6a449a5d..193c4535 100644
--- a/src/lxml/ElementInclude.py
+++ b/src/lxml/ElementInclude.py
@@ -186,9 +186,11 @@ def _include(elem, loader=None, _parent_hrefs=None):
"unknown parse type in xi:include tag (%r)" % parse
)
elif e.tag == XINCLUDE_FALLBACK:
- raise FatalIncludeError(
- "xi:fallback tag must be child of xi:include (%r)" % e.tag
- )
+ parent = e.getparent()
+ if parent is not None and parent.tag != XINCLUDE_INCLUDE:
+ raise FatalIncludeError(
+ "xi:fallback tag must be child of xi:include (%r)" % e.tag
+ )
else:
raise FatalIncludeError(
"Invalid element found in XInclude namespace (%r)" % e.tag