line numbers are now carried by most nodes, fixing xmlGetLineNo() c.f. bug
* SAX2.c tree.c: line numbers are now carried by most nodes, fixing
xmlGetLineNo() c.f. bug #309205
Daniel
diff --git a/SAX2.c b/SAX2.c
index d9f9a07..241e90d 100644
--- a/SAX2.c
+++ b/SAX2.c
@@ -2496,6 +2496,14 @@
if (ret == NULL) return;
parent = ctxt->node;
+ if (ctxt->linenumbers) {
+ if (ctxt->input != NULL) {
+ if (ctxt->input->line < 65535)
+ ret->line = (short) ctxt->input->line;
+ else
+ ret->line = 65535;
+ }
+ }
if (ctxt->inSubset == 1) {
xmlAddChild((xmlNodePtr) ctxt->myDoc->intSubset, ret);
return;
@@ -2548,6 +2556,14 @@
#endif
ret = xmlNewDocComment(ctxt->myDoc, value);
if (ret == NULL) return;
+ if (ctxt->linenumbers) {
+ if (ctxt->input != NULL) {
+ if (ctxt->input->line < 65535)
+ ret->line = (short) ctxt->input->line;
+ else
+ ret->line = 65535;
+ }
+ }
if (ctxt->inSubset == 1) {
xmlAddChild((xmlNodePtr) ctxt->myDoc->intSubset, ret);