xml validation against dtd not showing corrent line number of attribute error
XML Parsing against dtd on saxon, output shows in a incorrent line.
#2 Updated by Arun Pradeepan Balasubramanian 3 months ago
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'.
#3 Updated by Michael Kay 3 months 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.
Please register to edit this issue