Manual: Xinclude support

This way common error codes can be in their own file.

To use, add the xmlns:xi="http://www.w3.org/2001/XInclude
attribute to the top level node and use:

<xi:include href="file-to-include.xml"/>

The content of the file will be included verbatim.

Include files must be complete XML documents, but without
<?xml version="1.0" ?> at the top. Practically this means
all nodes within the file need to be contained in one root
element.

Caveat: There is no proper dependency for Xincludes files in
the Makefile, so you need to do make clean after changing an
included XML file!

Signed-off-by: Indan Zupancic <indan@nul.nu>
This commit is contained in:
Indan Zupancic
2024-03-12 10:53:58 +00:00
parent 9b50822b5a
commit 43607edb68
2 changed files with 8 additions and 1 deletions

View File

@@ -260,6 +260,7 @@ def main():
dtd = etree.XMLSchema(etree.parse(args.dtd))
for f in args.files:
xml = etree.parse(f)
xml.xinclude()
if not dtd.validate(xml):
logging.error("Failed to validate %s against %s" % (f, args.dtd))
logging.error(dtd.error_log)