homepage Welcome to WebmasterWorld Guest from 54.197.147.90
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / XML Development
Forum Library, Charter, Moderators: httpwebwitch

XML Development Forum

    
What is the best way to display data in an XML data feed?
escabar70




msg:4025084
 12:29 am on Nov 15, 2009 (gmt 0)

Hi, I just recently joined webmasterworld.com but have been viewing the forums for the past few years and I need some advice from the XML experts.

I am in the process of creating an online store, all of my products & product information is already stored in a huge XML file with over 500 products. I have been researching the best way to categorize and display the products in an html page.

To be more precise I need to have navigation links to groups of products, for example if a customer clicks "Alltell Wireless" it will only show the products with the tag <CarrierDescription>Alltel Wireless</CarrierDescription> Also I need to have individual pages for each of the 500 products.

here is an expert from the XML feed I will be using, note that this XML feed is being updated daily with new products.

<Table>
<CarrierDescription>Alltel Wireless</CarrierDescription>
<ManufacturerName>BlackBerry</ManufacturerName>
<ManufacturerCode>Pearl 8130 White</ManufacturerCode>
<ProductId>57557</ProductId>
<EquipmentName>BlackBerry Pearl 8130 White</EquipmentName>
<EquipmentType>Phone-PDA</EquipmentType>
<EquipmentShortDescription> </EquipmentShortDescription>

<EquipmentLongDescription>
The BlackBerry Pearl 8130 - a super-slim, ultra-light smartphone - is now available for Alltel customers in a crisp white shell. Like all BlackBerry devices, the BlackBerry Pearl 8130 provides a top notch on-the-go email solution for mobile professionals. But the BlackBerry Pearl 8130 also includes a good camera, a built-in music player, and broadband download speed for Web browsing. Best of all, this BlackBerry weighs in at a scant 3.2 ounces and is razor-thin - the smallest of its class.
</EquipmentLongDescription>
<SugRetailPrice>479.9900</SugRetailPrice>
<DisplayPrice>$999.99</DisplayPrice>
<EquipmentPrice>0</EquipmentPrice>
<NumericCost>-100.0000</NumericCost>
<RebateAmount>$100.00</RebateAmount>
<PriceAfterRebate>You make $100.00</PriceAfterRebate>
<RebateDescription>0.00 Mail-in<br>100.00 Mail-in</RebateDescription>
<EquipmentImageFileSmall>images/phones/bb_pearl8130w_alltel_s.jpg</EquipmentImageFileSmall>
<EquipmentImageFileMedium>images/phones/bb_pearl8130w_alltel_m.jpg</EquipmentImageFileMedium>
<EquipmentImageFileLarge>images/phones/bb_pearl8130w_alltel_l.jpg</EquipmentImageFileLarge>

<ManufacturerLogo>
_images/logos/manufacturers/selected_manu_blackberry.gif
</ManufacturerLogo>
<PurchaseMode>New Contract</PurchaseMode>

<ProductLink>
r.aspx?p=BlackBerry%20Pearl%208130%20White&c=Alltel%20Wireless&r=tigerdirect
</ProductLink>

<CompatibleAccessoriesPageURL>
DeviceSpecificAccessories.aspx?referringdomain=tigerdirect&refcode1=standarddatafeed&refcode2=&productid=57557
</CompatibleAccessoriesPageURL>
</Table>

My question is what scripting language would be best for this task?
-PHP using DOM & SimpleXML I am most experienced and comfortable with PHP but is this task to large and complicated for PHP to handle?
-XSLT do I have to load up the entire XML file in order to display only parts of it using XSLT? if so this would not be realistic because of loading time.
-JAVASCRIPT is this the best option for what im looking to accomplish?
-ASP I am not at all familiar with ASP but if it's the best choice I will learn

I am willing to study and learn a new language if required, I am most experienced in PHP.

Can some of the true experts please give me some guidance on how to implement this XML data feed into my website? thanks.

 

httpwebwitch




msg:4025145
 4:31 am on Nov 15, 2009 (gmt 0)

question 1: yes, PHP is a good choice for this.

question 2: yes, XSLT would need to load the entire XML file. If your XML is huge, you're right that's not a great solution.

question 3: JavaScript -- don't even go there :) JavaScript is capable of parsing XML, but it's not a good idea. Because JavaScript is executed in the client's browser, you'd have to send the entire XML to the browser, which makes it even worse than option #2

ASP is really no different than PHP. XSLT transformation is a little faster in ASP C#.NET, only if the stylesheet is compiled... but for selecting nodes with XPATH they're pretty much equivalent. Since you're more comfortable with PHP, that sounds like the best path for you.

You might want to consider using a relational database rather than an XML file. If you're receiving the data as XML, you can write a script that parses it and updates your database. It's a bit more work, but I'll guarantee SQL will find products faster than a complex XPATH expression.

Welcome to WebmasterWorld!

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / XML Development
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved