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

  • Home
  • SEARCH
  • 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 8658371
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T15:45:01+00:00 2026-06-12T15:45:01+00:00

How do i read out the Name value for the PROP’s I can read

  • 0

How do i read out the “Name” value for the PROP’s
I can read the PVAL’s using the script below..

<?xml version='1.0'?>
<RECORDS>
<RECORD>
<PROP NAME="Product">
    <PVAL><![CDATA[Produkt1]]></PVAL>
</PROP>
<PROP NAME="Value">
    <PVAL><![CDATA[10]]></PVAL>
</PROP>
<PROP NAME="Status">
    <PVAL><![CDATA[Active]]></PVAL>
</PROP>
</RECORD>
<RECORD>
<PROP NAME="Product">
    <PVAL><![CDATA[Produkt2]]></PVAL>
</PROP>
<PROP NAME="Value">
    <PVAL><![CDATA[20]]></PVAL>
</PROP>
<PROP NAME="Status">
    <PVAL><![CDATA[Active]]></PVAL>
</PROP>
</RECORD>
<RECORD>
<PROP NAME="Product">
    <PVAL><![CDATA[Produkt3]]></PVAL>
</PROP>
<PROP NAME="Value">
    <PVAL><![CDATA[30]]></PVAL>
</PROP>
<PROP NAME="Status">
    <PVAL><![CDATA[Active]]></PVAL>
</PROP>
</RECORD>

Using the script below i can get the PVAL’s.
But i would like to get the name values as well, i have tried
$strvalue = $node->PROP[6]->NAME; without luck…

<?php
$z = new XMLReader;
$z->open('products.xml');

$doc = new DOMDocument;

// move to the first <product /> node
while ($z->read() && $z->name !== 'RECORD');

// now that we're at the right depth, hop to the next <product/> until the end of the tree
while ($z->name === 'RECORD')
{

$node = simplexml_import_dom($doc->importNode($z->expand(), true));


$strvalue = $node->PROP[6]->PVAL;
echo $strvalue."<p>" ;

// go to next <product />
$z->next('RECORD');
}
?>
  • 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-12T15:45:03+00:00Added an answer on June 12, 2026 at 3:45 pm

    Here is a suggestion: use SimpleXMLElement($xml_string) this takes an xml string as input and returns a PHP object that you can work with more easily. Then you can do handy stuff like:

    $php_object = SimpleXMLElement($xml_string);
    var_dump($php_object);
    exit;
    

    And this will allow you to look at the structure of your object and decide how best to access it. Good luck.

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

Sidebar

Related Questions

Can you read out the name of a PHP constant from a database and
I'm trying to have Screenreaders (I'm testing with NVDA) read out the AutomationProperties.Name and
i`ve got a little problem with LINQ. I read out some information via XML-RPC.
I just can't realize why my read time out is not working. All I
I want to alter a record, but I don't want to read it out
I've read some topics about this, but still can't figure out how I can
Is there a name for a data structure (read: boolean) that can only be
I am trying read rss feed of stack overflow using Linq to xml. I
I have been trying to read an xml file. I have to extract value
I try to read out all existing calendars. I want have a HashMap with

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.