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 8491527
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T22:27:04+00:00 2026-06-10T22:27:04+00:00

I’m building a project on Ubuntu in which I’m using TinyXPath library along with

  • 0

I’m building a project on Ubuntu in which I’m using TinyXPath library along with TinyXml to parse the following xml:

<nodes>
    <node attribute1="1" attribute2="2" />
    <node attribute1="2" attribute2="3" />
    ...
    <node attribute1="10" attribute2="11" />
</nodes>

To find out the number of node entries contained, I’m using:

TinyXPath::i_xpath_int( xml_root,"count(/nodes/node)")

Apparently, using this function call in one object returns the actual number of nodes, 10; but using it in another object (a different class type), it always returns 0. I have checked to see if xml_root is the same object in both cases and both objects have the same address. Printing the contents gave me the same xml.

Instead, if I use TinyXML, I get the right result and I can even access all the atributes and get the right results. The following code gives the right no_nodes:

for(node = xml_root->FirstChild(); node; node = node->NextSibling())
    no_nodes++;

Here comes the weird part. If I build this project on Windows 7, it works just fine. The function call always returns the right number of nodes. Has anyone encountered this sort of problem before?

P.S.: I know that I haven’t given many specifics on this problem, but it is a huge project and it would take me days to explain it all. So this is just a shot in the dark.

  • 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-10T22:27:06+00:00Added an answer on June 10, 2026 at 10:27 pm

    By using gdb I found out that there was no parsing problem with the “count(/products/product)”, as I initially thought.

    The problem was that my project uses a lot of different libraries. One of these libraries used a different version of tinyxml from the one used by tinyxpath.

    When I linked the binary for the class from my project where tinyxpath didn’t work, i used the following command in my makefile:

    g++ -o binary -lahttplib -ltinyxpath [...]
    

    ahttplib already included an older version of tinyxml. So, when tinyxpath was linked in, it linked to the tinyxml library which was already included from ahttplib, instead of it’s own version. The tinyxml version from ahttplib and the one from tinyxpath were incompatible.

    The binary with the class from my project where tinyxpath worked fine only included tinyxpath, so the problem didn’t occur there.

    The simple solution was to change the link order: tinxypath before ahttplib.
    The right way to solve this issue is to make ahttplib and tinyxpath refer to the same tinyxml library.

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

Sidebar

Related Questions

I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
We're building an app, our first using Rails 3, and we're having to build
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I have a French site that I want to parse, but am running into

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.