Support #4935
closedxml validation against dtd not showing corrent line number of attribute error
0%
Description
XML Parsing against dtd on saxon, output shows in a incorrent line.
Files
Updated by Michael Kay over 3 years ago
Could you be more specific about the actual error and what is being reported?
However, Saxon can only report what the XML parser tells it. The results may well vary depending on which XML parser you are using. Parsers vary in the quality of their diagnostics.
Updated by Arun Pradeepan Balasubramanian over 3 years ago
- File 429_2020_2069.xml 429_2020_2069.xml added
Hi Kay, Attached XML contains error while parser against dtd
Saxon also showing error, but position at last line of the document. this is incorrect
actual error position is line no 995, column no 485, Reference to undeclared ID is 'other'.
Updated by Michael Kay over 3 years ago
An XML parser handling IDREF/ID validation cannot detect that there is an unresolved IDREF until it reaches the end of the document. At that point it can report the error, and the quality of the diagnostics will depend on design trade-offs made by the people who wrote the XML parser. They may choose to retain location information associated with the IDREF value, in which case they will be able to report where the unresolved IDREF appears, or they may choose to drop this information (to save on memory usage) in which case they can only report the content of the unresolved reference. This is a simple trade-off between performance and usability.
Saxon lets you choose your own XML parser, so choose one that makes these trade-offs the way you like them.
Apart from that, this is entirely outside Saxon's control. DTD validation is done by the XML parser, not by Saxon; Saxon just passes on the diagnostics that come back.
There's no bug here because the XML parser is almost certainly behaving as designed, and it is conformant with the specifications. And if it were a bug, it would be a bug in the XML parser, not in Saxon.
Updated by Michael Kay over 3 years ago
- Tracker changed from Bug to Support
- Status changed from New to Closed
Closing this with no further action. We have no control over the diagnostics from XML parsers.
Please register to edit this issue