I'm trying to build a web-based application for a client of mine and I keep finding holes in my design, so I could use some guidance if anyone has any to offer. Let me try to explain what it is I'm trying to do and hopefully someone has an idea that's not going to take me a long time to implement and isn't above my not-so-advanced skill level. My attempts with data tables and arraylists have failed thus far. Looks like my Sunday just got ruined, here we go...
I have a XML file that is created with real estate data that is pulled from a database. This database feed is through a RETS connector, so I have to set up an "admin" section where a single connection is made, data is read, and the XML file is created. I'm not able to either run the entire website off the RETS connection or create a new database because of connection and compatibility issues, so I'm left with XML.
Now, currently I have it set up where the RETS connection is made and a new XML file is created with the new data overwriting the existing one. The problem I'm having is with finding only the new or old data so I can either A) download it and the images associated with it if it's new data or B) if it's data that is no longer in the database, remove it and delete the images. Like I said I've tried a bunch of things with data tables and arraylists, but my attempts have not been successful.
Expand|Select|Wrap|Line Numbers
- XML Layout---
- <properties>
- <details>
- <id>13515</id>
- <type>Single Family</type>
- <bedrooms>2</bedrooms>
- .....
- </details>
- <details>
- <id>1534</id>
- <type>Condo</type>
- <bedrooms>1</bedrooms>
- .....
- </properties>
1. Remove any records that have duplicates along with their originals. This would leave me with only properties that have changed. (if you've seen my other posts recently, this is what I've been trying to do but last night it hit me that the next 2 tasks are going to be more difficult to implement)
2. Once I'm left with the rest of ids, I know that either A) they are old data that has been removed from the database or B) new data that has been added to the database since we last updated. Distinguishing between the 2 is my main problem. I already have the code set up to complete the tasks (download/delete images, etc), but my problem is making sure it's doing the correct thing with each id.
Little more on my RETS connection: It has 1700+ properties and I'm pulling a lot more data than the example XML above. The client wishes to run the app in the morning, updating the XML for the site so it has all the latest properties. I've already spent many hours getting the "base" data into my directories, now I have to make sure it's only finding the new properties and removing old ones so it runs for minutes rather than hours and hours like it took to get the 10,000+ photos.
One idea that has hit me as I'm typing this out is some kind of XML comparison. Would I be able to create 2 seperate XML files and compare/contrast them efficiently?
Thanks a million (again) if anyone can help me.