Merging 2 XML documents with identicle schema using Coldfusion?

View: New views
1 Messages — Rating Filter:   Alert me  

Merging 2 XML documents with identicle schema using Coldfusion?

by Leigh Romeo :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi All,

I want to know the best way to update an XML file (main store) from another XML file (updates only) which has only updates or new listings inside it.

I'm not looking to delete any nodes, just to copy over any new nodes if they don't exist and update current ones that do exist in the main XML file i am using.

Both XML have identical schema's and all i need to do is copy new nodes and update existing ones.

Any help is appreciated on the best method of achieving this. Thanks.

This is an example of the data i need to update:

<?xml version="1.0" standalone="no" ?>
<!DOCTYPE propertyList>
<propertyList date="2008-01-25-10:02:00"> <commercial modTime="2008-01-25-10:02:01" status="current">
  <companyID>5024</companyID>
  <uniqueID>CM5145</uniqueID>
  <commercialAuthority value="exclusive"/>
  <commercialListingType value="Lease"/>
  <underoffer value="no"/>
  <listingAgentID>GS4</listingAgentID>
  <listingAgentID2/>
  <price display="no">600000</price>
  <priceView/>
  <commercialRent period="annual" plusOutgoings="no">0.00</commercialRent>
  <outgoings>0.00</outgoings>
  <return>0.00</return>
  <currentLeaseEndDate/>
  <furtherOptions/>
  <address display="no">
   <lotNo>20</lotNo>
   <unitNo/>
   <streetNo>172</streetNo>
   <levelNo/>
   <streetName>San Fernando Drive</streetName>
   <suburb display="yes">WORONGARY</suburb>
   <area/>
   <region/>
   <state>QLD</state>
   <district/>
   <city/>
   <displaySuburb/>
   <geocode/>
   <buildingName/>
   <postal/>
   <country>AU</country>
   <postCode>4213</postCode>
  </address>
  <streetDirectory/>
  <commercialCategory name="Other"/>
  <headline>3 ACRES OF PRIME LAND</headline>
  <description>*  Zoned 'Park Living' *  Wonderful views of the coast *  Potential re-development site *  Current Zoning allows for 2 dwellings on site *  Sites like this are as rare as hen's teeth *  Contact Geoff Scott 0410 331 341</description>
  <saleMethod/>
  <landDetails>
   <area unit="squareMetre">0.00</area>
  </landDetails>
  <buildingDetails>
   <area unit="squareMetre">0.00</area>
  </buildingDetails>
  <carSpaces>0</carSpaces>
  <vendorDetails>
   <name/>
   <telephone type="BH"/>
   <telephone type="AH"/>
  </vendorDetails>
  <externalLink/>
  <images>
   <img id="m" file="CM5145_1.jpg"/>
  </images>
 </commercial>
 </propertyList>


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: http://www.houseoffusion.com/groups/XML/message.cfm/messageid:230
Subscription: http://www.houseoffusion.com/groups/XML/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user837.14401.3