(href, parse, encoding=None)
| 85 | # @throws OSError If the loader fails to load the resource. |
| 86 | |
| 87 | def default_loader(href, parse, encoding=None): |
| 88 | if parse == "xml": |
| 89 | with open(href, 'rb') as file: |
| 90 | data = ElementTree.parse(file).getroot() |
| 91 | else: |
| 92 | if not encoding: |
| 93 | encoding = 'UTF-8' |
| 94 | with open(href, 'r', encoding=encoding) as file: |
| 95 | data = file.read() |
| 96 | return data |
| 97 | |
| 98 | ## |
| 99 | # Expand XInclude directives. |