compare_xml
Try to do a 'xml-comparison' of want and got. Plain string comparison doesn't always work because, for example, attribute ordering should not be important. Ignore comment nodes, processing instructions, document type node, and leading and trailing whitespaces.
def compare_xml(
want: string,
got: string
) - > boolean
Try to do a 'xml-comparison' of want and got. Plain string comparison doesn't always work because, for example, attribute ordering should not be important. Ignore comment nodes, processing instructions, document type node, and leading and trailing whitespaces.
Parameters
| Name | Type | Description |
|---|---|---|
| want | string | The expected XML string or fragment to serve as the baseline for comparison |
| got | string | The actual XML string or fragment to be validated against the expected structure |
Returns
| Type | Description |
|---|---|
boolean | True if the XML structures are semantically equivalent, False otherwise |