Subject: [xsl] Delta between 2 xml docs in xslt From: Rich_Wheadon@xxxxxxxxxxxxxxxxxxx Date: Sat, 14 Jan 2006 01:29:31 -0500 |
Hello, I have done a considerable amount of research and perhaps have hit a wall I cannot cross. I am using a client running xalan-c version 1 upgrading is not an option. This process is the result of a generic data miner which creates an xml file following some very simple internal data structure. The generic xml file generated contains no attribute nor namespace other then the most rudimentary necessary for the xml to pass syntax. This file can now be transformed into whatever structure our vendors require to publish our records. To set the stage I am transforming generic (well formed) xml into specific xml or other file formats for vendor services we use. A new specification on one vendor requires me to have knowledge of current data on their system so that I can send records flagged for deletion/update/add. (Previously they simply scrapped the old records and replaced the entire inventory with the file I send) I have an xml structure via url which indicates to me what items I have currently active on their site, I am having difficulty figuring out how to walk the active content file and determine what exists on their site but not in my new file of records. Artifacts: DAILY FILE : My daily file being transformed into dtd compliant xml - <listing> <items> <item> <ItemID>1a2b</ItemID> <description>Something Green</description> <cost>1.00</cost> </item> <item> <ItemID>1b2c</ItemID> <description>Something Blue</description> <cost>1.00</cost> </item> <item> <ItemID>1b2b</ItemID> <description>Something Yellow</description> <cost>1.00</cost> </item> <item> <ItemID>1c2b</ItemID> <description>Something Black</description> <cost>1.00</cost> </item> </items> </listing> ACTIVE CONTENT FILE : The inventory file I can get via url from my vendor lists only the uniqueIDs i have active in their system: <doc> <uniqueItemID>1b2c</uniqueItemID> <uniqueItemID>1b2b</uniqueItemID> <uniqueItemID>1c2b</uniqueItemID> <uniqueItemID>1b2e</uniqueItemID> </doc> MY OUTPUT TO THE VENDOR : The final result should be something like: <inventory> <header> <headerCode>XXXXX</headerCode> <companyName>My Company</companyName> <otherStuff>and on and on</otherStuff> <products> <unit> <transactionType>Add</transactionType> <uniqueItemID>1a2b</uniqueItemID> <title>Something Green</title> <lowestPrice>1.00</lowestPrice> </unit> <unit> <transactionType>Update</transactionType> <uniqueItemID>1b2c</uniqueItemID> <title>Something Blue</title> <lowestPrice>1.00</lowestPrice> </unit> <unit> <transactionType>Update</transactionType> <uniqueItemID>1b2b</uniqueItemID> <title>SomethingYellow</title> <lowestPrice>1.00</lowestPrice> </unit> <unit> <transactionType>Update</transactionType> <uniqueItemID>1c2b</uniqueItemID> <title>Something Black</title> <lowestPrice>1.00</lowestPrice> </unit> <unit> <transactionType>Delete</transactionType> <uniqueItemID>1b2e</uniqueItemID> <title>Something Red and Purple</title> <lowestPrice>1.00</lowestPrice> </unit> </products> </inventory> in my example above I could default all records in the daily feed to update which would handle new and changed files fine, but I need to additionally create new nodes in the file for those in the active content file but not in the daily file. thanks in advance for any insights you might have.
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] Select first two elements, Florent Georges | Thread | RE: [xsl] Delta between 2 xml docs , cknell |
[xsl] Select first two elements, mac . rost | Date | RE: [xsl] Select first two elements, Michael Kay |
Month |