Jump to content
Larry Ullman's Book Forums

Search the Community

Showing results for tags 'xml'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Single Editions
    • Modern Javascript: Develop and Design
    • The Yii Book
    • Effortless Flex 4 Development
    • Building a Web Site with Ajax: Visual QuickProject
    • Ruby: Visual QuickStart Guide
    • C++ Programming: Visual QuickStart Guide
    • C Programming: Visual QuickStart Guide
    • Adobe AIR: Visual QuickPro Guide
  • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (5th Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (4th Edition)
    • PHP 6 and MySQL 5 for Dynamic Web Sites: Visual QuickPro Guide (3rd Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (2nd Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (1st Edition)
  • PHP for the Web: Visual QuickStart Guide
    • PHP for the Web: Visual QuickStart Guide (5th Edition)
    • PHP for the Web: Visual QuickStart Guide (4th Edition)
    • PHP for the Web: Visual QuickStart Guide (3rd Edition)
    • PHP for the World Wide Web: Visual QuickStart Guide (2nd Edition)
    • PHP for the World Wide Web: Visual QuickStart Guide (1st Edition)
  • Effortless E-commerce with PHP and MySQL
    • Effortless E-Commerce with PHP and MySQL (2nd Edition)
    • Effortless E-Commerce with PHP and MySQL
  • PHP Advanced: Visual QuickPro Guide
    • PHP Advanced and Object-Oriented Programming: Visual QuickPro Guide (3rd Edition)
    • PHP 5 Advanced: Visual QuickPro Guide (2nd Edition)
    • PHP Advanced: Visual QuickPro Guide
  • MySQL: Visual QuickStart Guide
    • MySQL: Visual QuickStart Guide (2nd Edition)
    • MySQL: Visual QuickStart Guide (1st Edition)
  • Other
    • Announcements
    • Newsletter, Blog, and Other Topics
    • Forum Issues
    • Social

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Found 3 results

  1. Anyone who is familiar with the topic "MLS® data feed" and all of the components in the subject line? I want to develop a program that can fetch MLS listing data from the appropriate MLS data servers in Canada and in the US for use by multiple user. My initial research shows that none of the "data feed" sources and specifications have anything to do with PHP and MySQL. Could anyone give me an idea how big the difference is between the specifications of RETS, IDX, DDF, XML and the specifications of PHP and MySQL? Thanks.
  2. As part of a larger project, I'm trying to generate an xml file using xmlWriter. The file is created and looks okay but I get an error - "This page contains the following errors: error on line 1 at column 1: Document is empty Below is a rendering of the page up to the first error." The rest of the page is blank. The source code only displays my error message "Problems creating file "fcTeams.xml". I've include a simplified version of my code which is where the error is coming from. Any ideas what's causing the error? $xml = new XMLWriter(); $xml->openUri('fcTeams.xml'); $xml->setIndent(true); $xml->setIndentString("\t"); $xml->startDocument(); $xml->startElement('teams'); $xml->startElement('fc'); $xml->writeAttribute('id', '03'); $xml->writeElement('name', 'Real Madrid'); $xml->writeElement('manager', 'Jose Mourinho'); $xml->writeElement('captain', 'Iker Casillas'); $xml->writeElement('stadium', 'Bernabeu'); $xml->startElement('player'); $xml->writeElement('name' , 'Christiano Ronaldo'); $xml->writeElement('position','forward'); $xml->writeElement('number','7'); $xml->writeElement('country','Portugal'); $xml->endElement(); $xml->startElement('player'); $xml->writeElement('name' , 'Kaka'); $xml->writeElement('position','midfielder'); $xml->writeElement('number','8'); $xml->writeElement('country','Brazil'); $xml->endElement(); $xml->endElement(); $xml->endElement(); $xml->endDocument(); header ('Content-type: text/xml'); if ($xml->flush() ) { echo 'File "fcTeams.xml" created.'; } else { echo 'Problems creating file "fcTeams.xml".'; }
  3. I'm trying to display an rss feed on a webpage and could use some help getting the data. The format of the feed is SimpleXMLElement Object ( [title] => HBR.org [id] => tag:blogs.harvardbusiness.org,2007-03-31:0.global-incremental [link] => SimpleXMLElement Object ( [@attributes] => Array ( [rel] => alternate [type] => text/html [href] => http://blogs.hbr.org/ ) ) [updated] => 2012-10-22T11:10:17Z [subtitle] => Practical insights, tools and resources from leading business thought leaders. [logo] => http://cbimages.ed4.net/hbsp/9380_225659.gif [entry] => Array ( [0] => SimpleXMLElement Object ( [title] => The Sad Truth Behind Growing Clashes at the WTO [id] => tag:blogs.harvardbusiness.org,2007-03-31:126.12422 [link] => SimpleXMLElement Object ( [@attributes] => Array ( [rel] => alternate [type] => text/html [href] => http://feeds.harvardbusiness.org/~r/harvardbusiness/~3/olpM1q4GSdM/the_sad_truth_behind_the_growi.html ) ) [published] => 2012-10-22T11:00:41Z [updated] => 2012-10-21T22:47:25Z [summary] => Don't be fooled by the rhetoric about protectionism. I want to get the title, href, published and summary data for the 3 most recent [entry]s. Code below is working for the most part but I dont know how to get to the href which is an attribute of link. I've tried a number of different syntaxes and foreach loops but unsuccessfully. //get the feed and create a variable to enable parsing of the data which is returned in xml format $feed = simplexml_load_file("http://feeds.harvardbusiness.org/harvardbusiness/"); echo '<ul id="rssFeed">'; $i=0; //parse the feed to get the title, link, published date and summary for each entry foreach ($feed->entry as $entry) { $pubdate = date("jS M, Y H:i", strtotime($entry->published)); echo '<li a href="' . $href . '">' . $entry->title . '</a> <p>' . $pubdate . '</p> <p>' . $entry->summary . '</p> </li>'; if ($i++ == 2) break; } //end foreach loop echo '</ul>'// end the ul tag Please can you suggest how I access the href value? Also I've used a counter and a break clause to stop the loop after 3 loops but I don't think this is the best practice. How would I get just the first 3 entries from the feed?
×
×
  • Create New...