diff options
author | scoder <none@none> | 2006-12-04 10:20:37 +0100 |
---|---|---|
committer | scoder <none@none> | 2006-12-04 10:20:37 +0100 |
commit | 25fce1f468f5265c904b078b75c3b45f190c3939 (patch) | |
tree | 6c5bc84c286d18dd40d98f289b88543068f69320 | |
parent | 5b54e9465117f17b80953d261223445a2122edf1 (diff) | |
download | python-lxml-25fce1f468f5265c904b078b75c3b45f190c3939.tar.gz |
[svn r2086] small fix to actually check if xi:fallback tag is misplaced before complaining
--HG--
branch : trunk
-rw-r--r-- | CHANGES.txt | 3 | ||||
-rw-r--r-- | src/lxml/ElementInclude.py | 8 |
2 files changed, 8 insertions, 3 deletions
diff --git a/CHANGES.txt b/CHANGES.txt index 4683d096..3e57a5a2 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -8,6 +8,9 @@ under development Features added -------------- +* ElementInclude module for ElementTree compatible XInclude processing that + honours custom resolvers registered with the source document + * ElementTree.parser property holds the parser used to parse the document * setup.py has been refactored for greater readability and flexibility. 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 |