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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T05:37:53+00:00 2026-06-11T05:37:53+00:00

<div id=dump-list> <div class=dump-row> <div class=dump-location odd data-jmapping={id: 35, point: {lng: -73.00898601, lat: 41.71727402},

  • 0
                    <div id="dump-list">    
<div class="dump-row"> 
 <div class="dump-location odd" data-jmapping="{id: 35, point: {lng: -73.00898601, lat: 41.71727402}, category: 'office'}">

    <div class="SingleLinkNoTx">
    <a href="#10" class="loc-link">Acme Software</a><br/><strong>John Doe, MBA</strong><br/>123 Main St.<br />New York, NY 10036<br /><strong class="telephone">(212) 555-1234</strong><br/>
    </div><!-- END.SingleLinkNoTx -->

    <a href="http://www.example.com" target="_blank" class="web_link">Visit Website</a><span><br />(0.3 miles)</span>   
    <div class="loc-info">
             <div class="loc-info-text ">
        John Doe, MBA<br /><a href="http://maps.google.com/?daddr=41.71727402,-73.00898601" target="_blank">Get Directions &raquo;</a>    
         </div>

    </div>

</div>

How is the above HTML parsed in PHP, so that non-class fields such as the company name, person’s name (John Doe, MBA), address, city, state zip code can be separated to their own variable using xpath? Thanks!

  • 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-11T05:37:54+00:00Added an answer on June 11, 2026 at 5:37 am

    Something among the lines of:

    $xpath->evaluate('//a[@class="loc-link"]//text()');
    

    $xpath is the xpath object with all the dom information, you can read more about it here. The evaluate function returns the content for the requested expression.

    The expression //a[@class="loc-link"]//text() tell xpath to look for any anchor a with the class attribute set to loc-link then within the anchor look for any (nested) textnode.

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

Sidebar

Related Questions

<div id=nav> <ul id=linkselect> <li class=important ><a href=home.html>Home</a></li> <li><a href=rlsdoc.html >Release Document</a></li> <li><a href=dtadmp.html>Data
Example Div: <div class=container> <div class=select1></div> <div class=select2></div> <div class=select3></div> </div> Now I want
struct Div { int i; int j; }; class A { public: A(); Div&
My div with class name 'header-body-right' doesn't seem to be floating to the left
Need a solution to kill nodes like <footer>foobar</footer> and <div class=nav></div> from many several
I have the following code in my main index.php: <div class=form> <?php $oForm =
I have this in HTML: <div class=dataBurst title=What is the Matrix?> <table align=center height=100%>
How? More to the point... this: $url = 'http://php.net/manual/en/class.domelement.php'; $client = new Zend_Http_Client($url); $response
selectedsong div has differents links with differents rel=... and the problems is... I'm using
this div to cover up the viewport works perfect on IE 7, 8, FF,

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.