- Speed up admitting simple paths and checking only elements
that match path level
- Avoid selection for * paths (about 35% faster)
- Add close() method to XmlResource
These attrs shouldn't be used to reopen the file object as:
- they may not reflect the original file or resource (file objects
opened from a zipfile will have a name that doesn't correspond to any
file on disk).
- Depending on how the fid was opened, these attrs could be crafted to
read arbitrary files from disk. If the creator of a .zip gives a file
inside the zip file a path of `/etc/passwd` we may end up opening that
file.
Instead of reopening the file, we keep track of the file object and seek
to the beginning of the file. This means (for most operations) the file
object must be seekable. On Python 2 urlopen returns an unseekable
object for 'file://' paths. One test had to be skipped in Python 2 for
this reason.
- Split decode()/encode() for components and for schemas
- Removed to_dict and to_etree for XSD components
- Updated fetch_schema_locations() to build XMLResource instance
- Added XMLResource.iterfind() for XPath iteration of a resource;
- Validator API refactored: remove path argument from iter_errors()
of components, add validate, is_valid, iter_errors to XMLSchema
class with additional arguments path and schema_path.
- Fix test case patterns.xml (now find also duplicated IDs)
- Fix SafeXMLParser and add tests for it
- SafeXMLParser raises only pure Python ParseError exception
- Add three XML cases with entities in xmlschema/tests/test_cases/resources/
- Remove SafeXMLParserError and use ElementTree.ParseError
- PyElementTree safe APIs errors are re-raised as C mod ParseError
- Simplify ElementTree API and XMLResource class
- The defusedxml seems to be unmaintained and has some problems
with the ElementTree loading
- Replaced by a safe XMLParser that forbids entities processing
- Added several tests
- Fixed start and end expression in regex.get_python_regex():
now puts '^(' and ')$' instead of '^' and '$'.
- Fixed '.' conversion in regex.get_python_regex(): raw string
qualifier removed from string literal.
- XMLResource.get_namespaces(): consider local root when adding
another default namespace
- Fix for XPath default namespace handling in ElementPathMixin
- Added namespaces argument to etree_tostring helper method.
- Refactored validator error string representation.
- Moved namespaces argument at last position for methods validate
and iter_errors of class ValidationMixin.
- Fixed document validate API and added tests for it
- Fix for issue #73
- Removed while cycle in iter_decode
- Consider that iter_decode_children methods yield only children
validation errors
- Added helper function etree_last_child
- Fix for normalize_url to replace backslashes.
- Created a check_url method for TestResources class.
- Use pathlib to check paths: PureWindowsPath class is
used for every Windows path (paths that contain '\\' or
':' or '|'), PurePath otherwise.
- Add leading slash to Windows paths with drive spec
before converting to URL.
- This is a more safer test for Element objects for this package, because it
also checks that the argument is not an instance of ElementPathMixin class
- Add tests for fetch_schema_locations and load_xml_resource functions
- ElementTree.parse() used when an URL is available.
- Skip source loading if not explicity requested (also if it's lazy).
- Add a remote test with Dublin Core schemas.
- Added copy(), __repr__ and __str__ to XMLResource class.
- Fixed XMLResource.get_locations(): now accepts also locations
already stored into a NamespaceResourcesMap dictionary.
- XMLSchema.iter_decode now always creates an XMLResource from
the source argument.
- Fix for XMLSchema.built property: has to count all namespace globals.
- Set default timeout=30 to fetch_* functions
- Use keyword arguments (**resource_options) for providing options
for XML resource related helper functions
- Add base_url to module level API
- Added XMLResource class for representing XML data sources
- Resource API now are based mainly on this class
- Attribute 'source' added to schema instances
- Now a warning message is sent to the logger for include or
for namespace import errors
- Add XMLSchemaImportWarning and XMLSchemaIncludeWarning
- Add warning attribute to schemas for collecting the message
strings about include and import warnings
- URIDict class removed (faulty with empty fragment #)
- Added --warning and --timeout to test factory arguments
- Removed --network from test factory arguments
- The normalization failed when url contains a .. or . subpaths
and base_url with a valid scheme is provided
- The fix could be also influence issue #44