Keith Sloan wrote at 2023-10-27 18:27 +0100:
> ...
>Where the files labelled with .xml type are not strictlly xml files as
>they have no <xml> ...content ... </xml> just valid include contents

You can "wrap" those files into a "prolog ... epilog".

If the files are small, you can use:

   parsed = lxml.etree.fromstring(PROLOG + open(file).read() + EPILOG)

If the files are so large that you do not want their content in memory,
you can use a wrapper class, which first produces the PROLOG,
then the file content and finally the EPILOG.
_______________________________________________
lxml - The Python XML Toolkit mailing list -- lxml@python.org
To unsubscribe send an email to lxml-le...@python.org
https://mail.python.org/mailman3/lists/lxml.python.org/
Member address: arch...@mail-archive.com

Reply via email to