XPath expression.
A key difference in handling schemaless XML and XML with a schema to which it should adhere is when constructing an XPath expression, knowing whether to say /x/y[1] or just /x/y If there is a schema it will likely say whether or not y is limited to a single occurrence.
If so then /x/y will always return a single node rather than nodeset.
If not then you need /x/y[1] (or better) to ensure it does.
Getting back a nodeset when you expect a node could break downstream code.
True?
It is likely the schema could change without your knowing it to loosen the cardinality by allowing multiple elements where before only single occurrences were allowed.
So the issue remains even with a schema of sorts.
I reckon if you are monitoring XML being passed around a network or the Internet you might be concerned to have a schema, else you would have to always cater for every element having multiple cardinality.
Painful. Yet the schema could change at any time without a change of namespace so you are still kept on your toes.
I think agile methods have led to these things
being only very rarely discussed and little advice
provided to developers.
--
----
Stephen D Green