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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T04:38:01+00:00 2026-05-16T04:38:01+00:00

how can i parse element like this example <?php $xmlstr = <<<XML <?xml version=’1.0′

  • 0

how can i parse element like this example

<?php

$xmlstr = <<<XML
<?xml version='1.0' standalone='yes'?>
<movies>
 <movie>
  <title>PHP: Behind the Parser</title>
  <characters>
   <character>
    <name>Ms. Coder</name>
    <actor>Onlivia Actora</actor>
    <actor:view id='44' />
   </character>
   <character>
    <name>Mr. Coder</name>
    <actor>El Act&#211;r</actor>
    <actor:view id='49' />
   </character>
  </characters>
  <plot>
   So, this language. It's like, a programming language. Or is it a
   scripting language? All is revealed in this thrilling horror spoof
   of a documentary.
  </plot>
  <great-lines>
   <line>PHP solves all my web problems</line>
  </great-lines>
  <rating type="thumbs">7</rating>
  <rating type="stars">5</rating>
 </movie>
</movies>
XML;


 $simpleXml = new SimpleXMLElement($xmlstr);

 var_dump((array) $simpleXml);

namespace error : Namespace prefix actor on view is not defined in /home/sweb/www/tmp/sxml.php on line 35

in /home/sweb/www/tmp/sxml.php on line 35

  • 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-16T04:38:02+00:00Added an answer on May 16, 2026 at 4:38 am

    XML parsers rely on the fact documents have to be strictly valid, and yours is not well-formed. It needs a namespace URI for actor. The root element should be along the lines of this:

    <movies xmlns:actor="http://yoururl.com/">
    

    As long as you don’t have it, no compliant XML parser will accept your document.

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

Sidebar

Ask A Question

Stats

  • Questions 506k
  • Answers 506k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer If possible, I Strongly recommed re-working your remote services to… May 16, 2026 at 3:46 pm
  • Editorial Team
    Editorial Team added an answer You need to .unbind() the previous event handler (which is… May 16, 2026 at 3:46 pm
  • Editorial Team
    Editorial Team added an answer @class is used to declare a class. Essentially telling the… May 16, 2026 at 3:46 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I've spent whole days with PHP's DOM functions but i can't understand how it
I've been wondering if there's a way to parse XML in Objective C as
I'm having some trouble parsing malformed XML in PHP. In particular I'm querying a
Currently this would be a sample XML that I am working on: <smsq> <sms>
I need t parse xml for an applescript project and i got a start
Does JSP or any related lightweight technology like JSTL perform HTTP POST data grouping,
In the example code below, I have a question about the List. My prof
Is it possible to define the scenes and the frames in XML in Flash
I'm trying to use dom4j to parse an xhtml document. If I simply print
I'm doing some transforms using xlinq and some of those transforms can result 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.