Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > PHP How-To
|
PHP How-To Post your "How do I do this with PHP?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 30th, 2007, 02:30 PM
Registered User
 
Join Date: Mar 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to KSchlund Send a message via MSN to KSchlund
Default php mulit sibling

Hello,

I am trying to list multiple siblings of CategoryParentName. The siblings can be a min of 2 to all the way till 7. Any help is appreciated. Refer to code below.

Topher

Code:
//get the nodes needed
            $catCount = $responseDoc->get_elements_by_tagname('CategoryCount');
            $suggestedCategories = $responseDoc->get_elements_by_tagname('SuggestedCategory');

            //display title and number of categories returned
            echo '<P><B>Suggested Categories - ', $catCount[0]->get_content(), '</B>';

            //go through each suggested category
            foreach($suggestedCategories as $cat)
            {
                //get SuggestedCategory details
                $catName = $cat->get_elements_by_tagname('CategoryName');
                $catId = $cat->get_elements_by_tagname('CategoryID');
                $percentItems = $cat->get_elements_by_tagname('PercentItemFound');
                $catParent = $cat->get_elements_by_tagname('CategoryParentName');
                //display suggested category
                echo '<BR>', $catParent[0]->get_content(), ', ', $catName[0]->get_content(), ' (', $catId[0]->get_content(), ') - ', $percentItems[0]->get_content(), '% of items';
            }
        }







Similar Threads
Thread Thread Starter Forum Replies Last Post
Using preceding-sibling mcanne98 Infopath 0 September 11th, 2008 11:09 PM
following-sibling. hanzelko XSLT 1 February 2nd, 2007 04:11 PM
preceding-sibling jonesyp XSLT 2 November 22nd, 2005 12:29 PM
MDI Sibling calling Sibling... Nick.Net VB.NET 2002/2003 Basics 1 December 8th, 2003 09:23 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.