Closed tomschr closed 8 years ago
Implementing xi:fallback causes the output to be dependent on external factors. As this is used to create static pages, it is a bad idea to allow that IMO.
As this is used to create static pages...
That sentence is very misleading. :) The whole XInclude process is to resolve XInclude elements and to create one single XML file. Not more, not less. "Static pages" sounds like you are thinking about HTML which is on a completely different page.
You already download your resource with the urllib
library. The only part that is missing is to check for an additional xi:fallback
element. If that element is available, copy the contents to your subtree. If it is not available, raise an error (as you already do).
That sentence is very misleading. :) The whole XInclude process is to resolve XInclude elements and to create one single XML file.
dbxincluder's purpose is to be used for DocBook documentation, not a general XInclude 1.1 processor (although it could be made one).
dbxincluder's purpose is to be used for DocBook documentation, not a general XInclude 1.1 processor (although it could be made one).
Well, actually dbxincluder replaces the internal xinclude()
method from lxml. Although this script/project is targeted at DocBook, it should contain the same functionality as the former xinclude()
method.
Of course, it doesn't have to be done all at once now. But if dbxincluder should replace/extend other ways, it should be at least feature parity with existing solutions.
Great, thanks a lot Fabian! :+1:
The XInclude specification allows the additional element
xi:fallback
. For example:The XInclude processor tries to retrieve
something_not_available.xml
. If that fails, thexi:fallback
is considered.According to the spec (see above link):
An interesting side note: the
xi:fallback
can contain axi:include
which can contain anxi:fallback
...