PDA

View Full Version : Help with XML


masears88
01-26-2009, 09:27 PM
I need some help with XML, i really haven't used this much but i need to, to be able to get what im trying to do. I am working with a company that they have a program that makes a new XML file everyday for inventory. Im trying to pull from that XML file so that i can list the current inventory on the site. How can i pull from the XML to make it work. This is the XML:

<?xml version="1.0"?>
<!-- Inventory export from GOLDEN GAIT TRAILERS on 04-22-2008 -->
<Inventory xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="C:\WebInventory\WebInventoryExtract.xsd">
<Unit rec_id="124*3141">
<web_dealer_id>124</web_dealer_id>
<stock_number>3141</stock_number>
<designation_code>N</designation_code>
<designation>NEW</designation>
<manufacturer>CARRY-ON</manufacturer>
<brand>CARRY-ON</brand>
<model>5X8SP</model>
<model_year>2008</model_year>
<type_code>OUT</type_code>
<type>OPEN UTILITY TRAILER</type>
<status_code>A</status_code>
<status>AVAILABLE</status>
<gl_location_code>GGT</gl_location_code>
<lot_location_code>GGT</lot_location_code>
<lot_location>GOLDEN GAIT TRAILERS</lot_location>
<web_desc>Open Utility Trailer with wire mesh floor, removable tongue, 2,000 lb cambered axle, 1 7/8&quot; coupler with safety chains, and fully lighted to DOT requirements.</web_desc>
<style>0</style>
<exterior_color>BLACK</exterior_color>
<length>8&apos;0&quot;</length>
<base_list>729.00</base_list>
<factory_list>729.00</factory_list>
<pdi_list>0.00</pdi_list>
<freight_list>0.00</freight_list>
<total_list>729</total_list>
<Spec>
<spec_desc>WIDTH</spec_desc>
<spec_detail>5&apos;</spec_detail>
</Spec>
<Spec>
<spec_desc>GVW</spec_desc>
<spec_detail>2000</spec_detail>
</Spec>
<Spec>
<spec_desc>WEIGHT</spec_desc>
<spec_detail>375</spec_detail>
</Spec>
<Spec>
<spec_desc>AXLE</spec_desc>
<spec_detail>SINGLE AXLE</spec_detail>
</Spec>
</Unit>
<Unit rec_id="124*3142">
<web_dealer_id>124</web_dealer_id>
<stock_number>3142</stock_number>
<designation_code>N</designation_code>
<designation>NEW</designation>
<manufacturer>CARRY-ON</manufacturer>
<brand>CARRY-ON</brand>
<model>4X6G</model>
<model_year>2008</model_year>
<type_code>OUT</type_code>
<type>OPEN UTILITY TRAILER</type>
<status_code>A</status_code>
<status>AVAILABLE</status>
<gl_location_code>GGT</gl_location_code>
<lot_location_code>GGT</lot_location_code>
<lot_location>GOLDEN GAIT TRAILERS</lot_location>
<web_desc>Open Utility Trailer with wire mesh floor, removable tongue, 2,000 lb cambered axle, 1 7/8&quot; coupler with safety chains, and fully lighted to DOT requirements.</web_desc>
<style>0</style>
<exterior_color>BLACK</exterior_color>
<length>6&apos;0&quot;</length>
<base_list>474.81</base_list>
<factory_list>474.81</factory_list>
<pdi_list>0.00</pdi_list>
<freight_list>0.00</freight_list>
<total_list>474.81</total_list>
<Spec>
<spec_desc>WIDTH</spec_desc>
<spec_detail>4&apos;</spec_detail>
</Spec>
<Spec>
<spec_desc>GVW</spec_desc>
<spec_detail>2000</spec_detail>
</Spec>
<Spec>
<spec_desc>WEIGHT</spec_desc>
<spec_detail>250</spec_detail>
</Spec>
<Spec>
<spec_desc>AXLE</spec_desc>
<spec_detail>SINGLE AXLE</spec_detail>
</Spec>
</Unit>


This is only two of the units i don't want to put it all up cause its really long. so i just need to know what to do about this? how do i call it. Right now we are having a thrid party do this for us, and we want to get rid of them. If you want to check out the inventory its something like this on this page. http://inventory.goldengait.com/inventory.cgi?cmd=search&type=OCH&desig=NEW i am creating a new site for this and i need to figure out how to do the inventory!

Ricky55
01-26-2009, 11:43 PM
What level are you at with programming you can probably do this with PHP, DJ one of the lads on here is your man for PHP.

Flash with Action Script 3 is also excellent at dealing with XML, you could quite easily build a front end in Flash that brings in your XML data.

If you go to these two sites they both have some really good video tuts on working with Flash and XML but you need to be using AS3, its has much better support.

http://www.gotoandlearn.com/

http://movielibrary.lynda.com/html/modPage.asp?ID=560

davidj
01-26-2009, 11:50 PM
as ricky says

you can parse it through php

you can use XSLT which allows you to style XML

both of which requires some learning

http://www.w3schools.com/xsl/