Get attribute XML with - - Hack The Tech - Latest News related to Computer and Technology

Hack The Tech - Latest News related to Computer and Technology

Get Daily Latest News related to Computer and Technology and hack the world.

Wednesday, July 5, 2023

Get attribute XML with -

I have this XML example:

<?xml version="1.0" encoding="UTF-8"?>
<batch xmlns="http://www.polopoly.com/polopoly/cm/xmlio">
  <content clear="true">
    <metadata>
      <contentid>
        <major>Article</major>
        <externalid>m2021.img.1.39971372</externalid>
        <minor>39971372</minor>
      </contentid>
      <input-template>
        <major>InputTemplate</major>
        <externalid>gele.FNtestxxx.Image2014v1</externalid>
      </input-template>
      <security-parent>
        <major>Department</major>
        <externalid>il-testatat.2014v1.site</externalid>
      </security-parent>

I need of "security-parent -> externalid".

How can I get it in php starting from this code?

$xml = simplexml_load_file($path);

$res = [];

foreach ($xml->content as $content) {

I doesn't use $cat = $content->metadata->securityparent->externalid;



source https://stackoverflow.com/questions/76615006/get-attribute-xml-with

No comments:

Post a Comment