[xml/sgml-pkgs] Bug#1115958: libxml2-16: Node line number is always 0

Sylvain Joubert joubert.sy at gmail.com
Mon Sep 22 14:25:07 BST 2025


Package: libxml2-16
Version: 2.14.5+dfsg-0.2
Severity: normal
X-Debbugs-Cc: joubert.sy at gmail.com

Dear Maintainer,

The Debian build of libxml2 always report 0 for the line number of a node
(xmlNode line field).
Using the following code:

#include <libxml/tree.h>
#include <iostream>
int main(int argc, char** argv)
{
  auto doc = xmlParseFile(argv[1]);

  auto rootNode = xmlDocGetRootElement(doc);
  std::cout << rootNode->line << '\n';

  auto childNode = xmlFirstElementChild(rootNode);
  while (childNode)
  {
    std::cout << '.' << childNode->line << '\n';
    childNode = xmlNextElementSibling(childNode);
  }

  xmlFreeDoc(doc);
  return 0;
}

and passing the following file as input:
<?xml version="1.0" encoding="UTF-8"?>
<root>
  <child/>
  <child/>
</root>

I get the output:
0
.0
.0

Building this example with an upstream version built locally I get the
expected:
2
.3
.4

Sylvain


-- System Information:
Debian Release: forky/sid
  APT prefers testing
  APT policy: (990, 'testing'), (800, 'stable-updates'), (800, 'stable'), (700, 'unstable'), (90, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 6.16.7+deb14-amd64 (SMP w/8 CPU threads; PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages libxml2-16 depends on:
ii  libc6     2.41-12
ii  liblzma5  5.8.1-1.1
ii  zlib1g    1:1.3.dfsg+really1.3.1-1+b1

libxml2-16 recommends no packages.

libxml2-16 suggests no packages.

-- no debconf information



More information about the debian-xml-sgml-pkgs mailing list