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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T01:43:10+00:00 2026-05-15T01:43:10+00:00

I am trying to access certain pieces of data from an xml file, here

  • 0

I am trying to access certain pieces of data from an xml file, here is the problem.

###XML FILE
<products>
    <product>
        ....
        ....
    </product>
    <product>
        ....
        ....
    </product>
    etc...
</products>

I know that the piece of data I need is in ($products->product->myProdNode) I have this mapping (and many others) stored in my database as a string e.g.’product->prodCode‘ or ‘product->dedscriptions->short_desc‘ How can I access this data by using the strings stored in my database.

Thanks for you help in advance!

  • 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-05-15T01:43:11+00:00Added an answer on May 15, 2026 at 1:43 am

    I think if you replace your -> with forward slash (/), they effectively become Xpath and you can query Node contents like that.

    E.g

    'product->dedscriptions->short_desc' should be mapped to
    'product/dedscriptions/short_desc'
    

    Please read more on Xpath here

    E.g. In C#

    XmlNode.SelectSingleNode(“product/dedscriptions/short_desc”).InnerText will get the short description text

    In php

    $result = $record->xpath(‘descriptions/short_description’);

    while(list( , $node) = each($result)) {
    echo ‘Results is: ‘,$node,”\n”;
    }

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

Sidebar

Related Questions

I'm trying to access the news stream to pan for certain events I'm running
I have a number of tables that I'm trying to access in CodeIgniter, and
I'm trying to access a getJson array I created to add image references to
I am trying to access a web API using a POST technique. I AM
I am trying to access a Grid inside the DataTemplate while the ItemsControl is
I'm trying to access the level of the mic through Java. I don't need
We are upgrading our application from JBoss 4 to JBoss 6. A couple of
I'm automating ie from within Excel VBA like this, in part Set ie =
I am trying to configure Apache2 so I can use MySQL for authenticating users
Not a specific code question, but more of a general coding question. I'm trying

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.