diff options
author | Nick Wellnhofer <wellnhofer@aevum.de> | 2023-04-30 21:24:50 +0200 |
---|---|---|
committer | Nick Wellnhofer <wellnhofer@aevum.de> | 2023-04-30 21:45:39 +0200 |
commit | 165f3436fceb50a27842d9d21ff22e9d79c7dfeb (patch) | |
tree | f9b0eb383c01d205f400f0f8a4a9599746aa35a7 | |
parent | 57d88da6757457b9dfa168c1f61a5b0850883850 (diff) | |
download | libxml2-165f3436fceb50a27842d9d21ff22e9d79c7dfeb.tar.gz |
schemas: Fix line numbers in streaming validation
-rw-r--r-- | xmlschemas.c | 10 |
1 files 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 { /* |