From 165f3436fceb50a27842d9d21ff22e9d79c7dfeb Mon Sep 17 00:00:00 2001 From: Nick Wellnhofer Date: Sun, 30 Apr 2023 21:24:50 +0200 Subject: schemas: Fix line numbers in streaming validation --- xmlschemas.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/xmlschemas.c b/xmlschemas.c index 4662ebbf..8e6fc40c 100644 --- a/xmlschemas.c +++ b/xmlschemas.c @@ -2143,8 +2143,14 @@ xmlSchemaErr4Line(xmlSchemaAbstractCtxtPtr ctxt, (vctxt->parserCtxt != NULL) && (vctxt->parserCtxt->input != NULL)) { file = vctxt->parserCtxt->input->filename; - line = vctxt->parserCtxt->input->line; - col = vctxt->parserCtxt->input->col; + if (vctxt->inode != NULL) { + line = vctxt->inode->nodeLine; + col = 0; + } else { + /* This is inaccurate. */ + line = vctxt->parserCtxt->input->line; + col = vctxt->parserCtxt->input->col; + } } } else { /* -- cgit v1.2.1