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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T19:58:04+00:00 2026-05-29T19:58:04+00:00

I urgently need to know how to read the following XML file: <uclassify xmlns=http://api.uclassify.com/1/ResponseSchema

  • 0

I urgently need to know how to read the following XML file:

<uclassify xmlns="http://api.uclassify.com/1/ResponseSchema" version="1.00">
<status success="true" statusCode="2000"/>
  <readCalls>
    <classify id="cls1">
      <classification>
        <class className="negative" p="0.741735"/>
        <class className="positive" p="0.258265"/>
      </classification>
    </classify>
  </readCalls>
</uclassify>

I need to know the following:

$status_code = ... (should be 2000)
$negative = ...  (the value of p, should be 0.741735)
$positive = ...  (the value of p, should be 0.258265)

Best regards

Andre

  • 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-29T19:58:06+00:00Added an answer on May 29, 2026 at 7:58 pm
    $xml= simplexml_load_file('temp.xml');
    
    foreach($xml->status->attributes() as $name => $value ){
        echo $name.' '.$value.'<br>';
        }
    foreach($xml->readCalls->classify->classification->children() as $node ){
        foreach($node->attributes() as $name => $value)
         echo $name.' '.$value.'<br>';
        }
    

    o/p:

    success true
    statusCode 2000
    className negative
    p 0.741735
    className positive
    p 0.258265

    If you want to store them :

    $status_code = (string)$xml->status->attributes()->statusCode;
    foreach($xml->readCalls->classify->classification->class as $node ){
        ${(string) $node->attributes()->className} = (string) $node->attributes()->p;
        }
    echo $status_code.' '.$positive.' '.$negative;  
    

    o/p:

    2000 0.258265 0.741735

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

Sidebar

Related Questions

Hey. I urgently need some help on building up a complete table using VBA.
i'm just a begginer in perl, and very urgently need to prepare a small
I am currently learning regex but need this quite urgently. I have a set
We've inherited some legacy software that we need to run quite urgently. It was
This is more of a challenge question than something I urgently need, so don't
I know that I can check the current state of Delphi's switch directives using
In my main activity I am having a method that I need to call
I am not a time traveller from past, but I need NT4 Option Pack
I am rather noob at java jars deployment. I have following scenario: I have
Ha ii,everybody,i just want to know about how to get or download ios-4.3 in

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.