homepage Welcome to WebmasterWorld Guest from 54.196.159.11
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / XML Development
Forum Library, Charter, Moderators: httpwebwitch

XML Development Forum

    
Converting XML structure to XML structure
Converting XML structure to XML structure
zorab




msg:4131623
 8:36 pm on May 12, 2010 (gmt 0)



Hello guys

Here is the story.

I do have a real estate website which is having the option to import XML files.
My website XML structure its quite simple and looks like this:
<?xml version='1.0' ?>
<listings>
<listing>
<id></id>
<user_id></user_id>
<category_id></category_id>
<package_id></package_id>
<usr_pkg></usr_pkg>
<date_added></date_added>
<date_expires></date_expires>
<title></title>
<description></description>
<price></price>
<currency></currency>
<country></country>
<region></region>
<city></city>
<zip></zip>
<meta_description></meta_description>
<meta_keywords></meta_keywords>
<sold></sold>
<rented></rented>
<viewed></viewed>
<user_approved></user_approved>
<active></active>
<pending></pending>
<featured></featured>
<highlited></highlited>
<priority></priority>
<video></video>
<rating></rating>
<language></language>
<property_type></property_type>
<bedrooms></bedrooms>
<bathrooms></bathrooms>
<area></area>
<year_built></year_built>
<estate_condition></estate_condition>
<amenities></amenities>
<community_amenities></community_amenities>
<type1></type1>
<category></category>
<pictures></pictures>
</listing>
</listings>
Now i have a an XML file and i would like to import it into my website, but this XML structure its not as MY website XML structure. This XML structure looks like this.
<?xml version='1.0' encoding='UTF-8' ?>
<root>
<feed_version>2</feed_version>
<property>
<id></id>
<date></date>
<ref></ref>
<price>0</price>
<price_freq>sale</price_freq>
<part_ownership>0</part_ownership>
<leasehold>0</leasehold>
<type>
<en>Villa</en>
</type>
<town></town>
<province></province>
<location_detail></location_detail>
<beds>0</beds>
<baths>0</baths>
<pool>0</pool>
<surface_area>
</surface_area>
<url></url>
<desc>
<en> </en>
<es> </es>
</desc>
<images>
<image id="1">
<url></url>
<title>
<en></en>
</title>
</image>
<image id="2">
<url></url>
<title>
<en></en>
</title>
</image>
<image id="3">
<url></url>
<title>
<en></en>
</title>
</image>
<image id="4">
<url></url>
<title>
<en></en>
</title>
</image>
</images>
</property>
So i am in need of some tool or software to be able to convert it with less intervention from my self as much as is possible. To look like my XML website structure.
To get a little bit more deeper its possible to make a script or a component something to get the XML over the internet and to import it automatically lets say everyday or from time to time ?
I am trying to explain as much as i can but i think you got the idea.
My website its written in PHP.

Thanks a lot

 

httpwebwitch




msg:4135699
 4:25 am on May 20, 2010 (gmt 0)

All that you suggest are possible using PHP.

To transform one XML file into another, you might use XSLT [php.net].
Or, you might parse the XML using an XML parser [php.net], and build a new one by concatenating strings [php.net] together.

Then to have it done daily without intervention, you will set up that script as a cron job [webmasterworld.com].

Good luck!

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