HI
I am trying to load data from an XML file to a custom Schema created on the campaign. the file will come everyday so I will do an incremental load. the file is around 200 MB . with that says what are the options? when I use the file load task on the workflow seems like not mapping it correctly and I dont see that its build for xml ( looks like only Flat files and csv) unless I am missing something?
Also I looked at the js Api documentation and there is loadXmlFile(filename [, noErr ]) function .
anyone can give me a suggestions?
below is a sample xml that I will be loading
</products>
</purchaseRebate>
<item>Claim by Jan 16, 2018</item>
</validDates>
</program>
</programs>
</ns2:LocalProductRebatesFeed>
Views
Replies
Total Likes
Hi Vendim,
I'm pasting here the last DM I shared in case it can be used by other members:
So the loadXmlFile function is deprecated. You can use instead the load (DOMDocument) function (which contains a basic example in the JSAPI documentation) and combine with other reading functions such as getElements and getValue.
For example, for an XML file containing products like this:
<product>
<name>abc</name>
<code>123</code>
</product>
You can start using something like this in a JS activity:
var doc = DOMDocument.load("data/test.xml");
var products = doc.root.getElements("product");
for (var i=0; i<product.length; i++) {
var product = products[i];
var name = product.getValue("name");
var code = product.getValue("code");
}
I don't have much JS knowledge but starting from this you should be able to apply the processing you want on the data, for example to transform the XML in a more readable format. After the JS activity you could use a data loading (file) activity and then update the database.
Florent