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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T15:34:39+00:00 2026-06-03T15:34:39+00:00

what my program effectively is attempting to do is grab data from an xml

  • 0

what my program effectively is attempting to do is grab data from an xml file (that used to be an svg file). and with this grab the relevant information from the xml tags as attributes and values.
I have my php set like this

foreach($xml_file_open->g->path[0]->attributes() as $attribute => $value)
{
echo $attribute => $value
}

and the output for the xml_file_open attributes request is

style="fill:#ff0000;fill-rule:evenodd;stroke:#000000;
stroke-width:1px;stroke-linecap:butt;stroke-linejoin:
miter;stroke-opacity:1"
id="path2987"
d="m 631.42859,603.79077 a 212.85715,162.85715 0 1 1
-425.7143,0 212.85715,162.85715 0 1 1 425.7143,0 z" 

(3 lines with style and d being intentionally split for readability)
whereas instead of getting those 3 lines of data I am attempting to get everything within this tag

<path
   sodipodi:type="arc"
   style="fill:#ff0000;fill-rule:evenodd;stroke:#000000;stroke-width:1px;
stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
   id="path2987"
   sodipodi:cx="418.57144"
   sodipodi:cy="603.79077"
   sodipodi:rx="212.85715"
   sodipodi:ry="162.85715"
   d="m 631.42859,603.79077 a 212.85715,162.85715 0 1 1
 -425.7143,0 212.85715,162.85715 0 1 1 425.7143,0 z" />

it seems to be the sodipodi: that it won’t read as an attribute, how would I get it to read sodipodi:cx/cy etc as an attribute?

  • 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-03T15:34:41+00:00Added an answer on June 3, 2026 at 3:34 pm

    Pass the namespace URI to the attributes method to access prefixed attributes:

    $attrs = $node->attributes('http://inkscape.sourceforge.net/DTD/sodipodi-0.dtd');
    echo $attrs['cx'];
    

    More info at: https://www.php.net/manual/en/simplexmlelement.attributes.php

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

Sidebar

Related Questions

I have some code that effectively does this : File file = new File(C:\\Program
My program is now still running to import data from a log file into
How to effectively send a file from my own process to a program such
I'm trying to write a program that cleans data, using Matlab. This program takes
I am creating a program that is effectively an sprite creator. I'm very new
I'd like to write a program that effectively pipes Powershell, so that I can
I am embedding Python into my C++ program, and have used PyRun_SimpleString quite effectively
I have a program that I want to convert from RPGIII to RPGIV. I
Program runs once and it both throws data to the pipe and gets it
This program I use has it's own variables to set when you run it,

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.