|
1 | 1 | [](https://pypi.org/project/robotframework-xmlvalidator/) |
2 | 2 | [](LICENSE) |
3 | 3 | [](https://github.com/MichaelHallik/robotframework-xmlvalidator/actions/workflows/test.yml) |
4 | | -<!-- [](https://pepy.tech/projects/robotframework-xmlvalidator) --> |
5 | | -[](https://pepy.tech/project/robotframework-xmlvalidator) |
| 4 | +[](https://pepy.tech/project/robotframework-xmlvalidator) |
6 | 5 |
|
7 | 6 | <details> |
8 | 7 | <summary><strong>📚 Table of Contents</strong></summary> |
|
26 | 25 | - [Further examples](#further-examples) |
27 | 26 | - [Using the library](#using-the-library) |
28 | 27 | - [Keyword overview](#keyword-overview) |
| 28 | + - [Error collection](#error-collection) |
29 | 29 | - [Keyword documentation](#keyword-documentation) |
30 | 30 | - [Keyword example usage](#keyword-example-usage) |
31 | 31 | - [A few basic examples](#a-few-basic-examples) |
@@ -215,6 +215,63 @@ Of course, you may also refer to specific XML/XSD files (instead of to folders). |
215 | 215 |
|
216 | 216 | See for more details the [keyword documentation](https://michaelhallik.github.io/robotframework-xmlvalidator/XmlValidator.html). |
217 | 217 |
|
| 218 | +### Error collection |
| 219 | + |
| 220 | +Errors that are collected and returned can be categorized as follows: |
| 221 | + |
| 222 | +1. XSD Schema violations. |
| 223 | + |
| 224 | +The following types of XSD schema violations are detected during validation: |
| 225 | + |
| 226 | +1. Detects missing or extra elements that violate cardinality rules, e.g.: |
| 227 | + - Verifies that all mandatory elements (minOccurs > 0) are present in the XML. |
| 228 | + - Ensures that optional elements (minOccurs = 0) do not exceed their maximum allowed occurrences (maxOccurs). |
| 229 | + |
| 230 | +2. Sequence and Order Violations: |
| 231 | + - Validates the order of child elements within a parent element if the schema specifies a sequence model (`<xsd:sequence>`). |
| 232 | + - Detects elements that are out of order or missing in a sequence. |
| 233 | + |
| 234 | +3. Datatype Violations: |
| 235 | + - Ensures that element and attribute values conform to their specified datatypes (e.g., xs:string, xs:integer, xs:dateTime). |
| 236 | + - Identifies invalid formats, such as incorrect date or time formats for xs:date and xs:dateTime. |
| 237 | + |
| 238 | +4. Pattern and Enumeration Violations: |
| 239 | + - Checks that values conform to patterns defined using `<xsd:pattern>`. |
| 240 | + - Ensures that values fall within allowed enumerations specified in the schema. |
| 241 | + |
| 242 | +5. Attribute Validation: |
| 243 | + - Verifies that required attributes are present. |
| 244 | + - Ensures that attribute values adhere to their declared datatypes and constraints. |
| 245 | + |
| 246 | +6. Namespace Compliance: |
| 247 | + - Validates that elements and attributes belong to the correct namespaces as defined in the schema. |
| 248 | + - Detects namespace mismatches or missing namespace declarations. |
| 249 | + |
| 250 | +7. Group Model Violations: |
| 251 | + - Validates conformance with `<xsd:choice>` and `<xsd:all>` group models, ensuring correct usage of child elements as per the schema. |
| 252 | + |
| 253 | +8. Referential Constraints: |
| 254 | + - Checks for violations in `<xsd:key>`, `<xsd:keyref>`, and `<xsd:unique>` constraints. |
| 255 | + |
| 256 | +9. Document Structure and Completeness: |
| 257 | + - Ensures that the XML document adheres to the hierarchical structure defined by the schema. |
| 258 | + - Detects incomplete or improperly nested elements. |
| 259 | + |
| 260 | +10. General Schema Violations: |
| 261 | + - Detects schema-level issues, such as invalid imports or includes, during schema compilation if they affect validation. |
| 262 | + |
| 263 | +2. Errors following from malformed XML and/or XSD files. |
| 264 | + |
| 265 | + Checks whether handling of the involved XML file (e.g. during dynamic schema matching) resulted in an error. For instance because a file: |
| 266 | + - does not exist (i.e. could not be found at the spefified location) |
| 267 | + - is empty |
| 268 | + - is not of the correct file type (.xml, .xsd) |
| 269 | + - is not well-formed (syntactycally correct) |
| 270 | + |
| 271 | +Any such error does not lead to a failing test, but is collected and reported. |
| 272 | + |
| 273 | +However, when, at the end of a test run one or more errors have been collected, the test will be marked as 'FAILED'. |
| 274 | + |
218 | 275 | ### Keyword documentation |
219 | 276 |
|
220 | 277 | See the [keyword documention](https://michaelhallik.github.io/robotframework-xmlvalidator/XmlValidator.html). |
@@ -425,7 +482,7 @@ See [CONTRIBUTING.md](CONTRIBUTING.md). |
425 | 482 |
|
426 | 483 | The overall process: |
427 | 484 |
|
428 | | - |
| 485 | + |
429 | 486 |
|
430 | 487 | This project uses Poetry for dependency and packaging management. |
431 | 488 |
|
@@ -510,7 +567,7 @@ GitHub Actions CI is defined under [github/workflows/](.github/workflows/), in p |
510 | 567 |
|
511 | 568 | The test workflow: |
512 | 569 |
|
513 | | - |
| 570 | + |
514 | 571 |
|
515 | 572 | In [.github/](.github/) you’ll also find the various contribution templates: |
516 | 573 |
|
|
0 commit comments