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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T05:36:24+00:00 2026-06-11T05:36:24+00:00

if($xml = simplexml_load_file($validationURL . &output=soap12)) { echo Success; } else { echo Failed; }

  • 0
if($xml = simplexml_load_file($validationURL . "&output=soap12"))
{
   echo "Success";  
}
else
{
    echo "Failed";
}

So This always fails. $validationURL is “http://validator.w3.org/check?uri=http://uvm.edu/~mfurland/cs148/assign1/projects.php”

http://validator.w3.org/check?uri=http://uvm.edu/~mfurland/cs148/assign1/nav.php&output=soap12 works in a browser, but it isn’t working in my code. If I use file(), I get an array, but it’s all strings with a bunch of characters I can’t see. Like it has a twenty or thity character string that looked like ” 0 “. What am I doing wrong here? Nobody else seems to have this issue.

Contents of the file when you look at in a browser:

    <m:uri>http://www.uvm.edu/~mfurland/cs148/assign1/projects.php</m:uri>
    <m:checkedby>http://validator.w3.org/</m:checkedby>
    <m:doctype>HTML5</m:doctype>
    <m:charset>utf-8</m:charset>
    <m:validity>true</m:validity>
    <m:errors>
        <m:errorcount>0</m:errorcount>
        <m:errorlist></m:errorlist>
    </m:errors>
    <m:warnings>
        <m:warningcount>1</m:warningcount>
        <m:warninglist></m:warninglist>
    </m:warnings>
</m:markupvalidationresponse>
</env:Body>
</env:Envelope>
  • 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-11T05:36:25+00:00Added an answer on June 11, 2026 at 5:36 am

    I often have to communicate with web services that use namespaces. There’s two options available to you; register the namespace with SimpleXML, or remove the : character from the tags.

    Removing the : might be easier, but might not be the neatest option, depending on what you want to do with the data.

    To remove the colon character:

    $xml_content = file_get_contents($validationURL . '&output=soap12');
    $xml_content = preg_replace("/(<\/?)(\w+):([^>]*>)/", "$1$2$3", $xml_content);
    $xml = simplexml_load_string($xml_content);
    

    Alternatively, to work with the namespaces, see this article Parse XML with Namespace using SimpleXML

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

Sidebar

Related Questions

I'm using this PHP to parse a XML file: <?php $xml = simplexml_load_file(http://api.imgur.com/2/image/zzFV5.xml); echo
I've this code $xml = simplexml_load_file(http://api.hostip.info/?ip=12.215.42.19); echo $xml->getName() . <br />; foreach($xml->children() as $child)
$q = $_GET['q']; // Load and parse the XML document $rss = simplexml_load_file('http://search.twitter.com/search.atom?lang=en&q=$q&rpp=100&page=1'); This
My code: <? $url = 'http://w1.weather.gov/xml/current_obs/KGJT.xml'; $xml = simplexml_load_file($url); ?> <? echo $xml->weather, ;
I have an xml object like this $obj = simplexml_load_file('/path/to/file.xml'); i also create one
Simplexml fails with the following error message: simplexml_load_file(): fooo.xml:299108: parser error : Char 0xFFFE
THIS WORKS: 1 $number = 2; 2 $allofit = simplexml_load_file(thexmlfile.xml); 3 $thebook = $allofit
Below is my code: foreach(simplexml_load_file('http://www.bbc.co.uk/radio1/playlist.xml')->item as $link){ $linked = $link->artist; $xml_data = file_get_contents('http://ws.audioscrobbler.com/2.0/?method=artist.getimages&artist=' .
I have this: $xml = simplexml_load_file('test.xml'); print<pre>; print_r($xml); It printout this: SimpleXMLElement Object (
I have the following code to read in an XML file: $xml2 = simplexml_load_file('http://www.facebook.com/feeds/page.php?format=rss20&id=334704593230758');

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.