Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8962001
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T16:01:37+00:00 2026-06-15T16:01:37+00:00

In libxml2, I can easily find the source line that an xmlNode came from

  • 0

In libxml2, I can easily find the source line that an xmlNode came from (xmlNode::line), but I can’t see how to find the name of the file that it came from. This is especially useful when the loaded document contains XInclude directives. While I can think of manual ways of handling this (look for xml:base attribute above the given node; manually store the file name and use that if xml:base is not set), I’d rather use something built into libxml2.

Is there a function for retrieving the file name from which any given xmlNode object was loaded?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T16:01:38+00:00Added an answer on June 15, 2026 at 4:01 pm

    Doesn’t look like it. Documentation for xmlDocPtr says that name is “name/filename/URI of the document”, but this isn’t getting populated in my tests with xmlReadFile.

    Looking through the code, it looks like the filename isn’t saved in the doc, and the parser context disappears at the end of parser.c’s xmlDoRead().

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a source file that I can run via the terminal using gcc
I am getting this error after adding the libxml2.2.dylib file Linking /Users/Biranchi/Desktop/Funmovies TabBarController/build/Debug-iphonesimulator/funmovies.app/funmovies (1
Apart from lxml , is anyone aware of Python packages that depend on libxml2
With libxml2, we can use xmlGetLineNo to get the line number in which a
I am attempting to install libxml2 so that I can setup the python bindings
I can’t work out why I’m getting this error from Nokogiri when I start
File /usr/local/lib/python2.5/site-packages/libxml2.py, line 1, in <module> import libxml2mod ImportError: /usr/local/lib/python2.5/site-packages/libxml2mod.so: undefined symbol:xmlTextReaderSetup >>> import
somewhat related to: libxml2 from java yes, this question is rather long-winded - sorry.
We are looking, the script that can easily replace the value using PHP DOM.
I'm using libxml2 for SOAP-Actions in an iPhone App. The big problem is that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.