How to change the custom metadata fields in an XML file


The XML format enables bulk ingestion of complex video or audio packages. In addition, you can customize the structure of the metadata and elements that are part of your XML file. You can read more about bulk upload with XML in our articles What is bulk upload and FTP content ingestion? and What is KML bulk upload?

Example XML file with comments

<?xml version="1.0"?> 

<!--the row above and this part below should not change--> 

<mrss xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="ingestion.xsd"> 
<channel> 
<item> 
<action>update</action> 

<!--here you determine the entry ID you want to update--> 

<entryId>0_bukomjmo</entryId> 

<!--name and description are textual values with little to none limitations (maybe just the length)--> 

<name>TEST</name> 
<description>TEST</description> 

<!--only in the category part, write the categories by their accurate names. to show categories hierarchy, start with the highest one and put the > sign between them with no spaces. you can add or remove as much <category>XXX</category> fields as you wish. If the categories do not exist, like in the second example, they will be created--> 

<categories> 
<category>Events>2014</category> 
<category>Events>TEST</category> 
</categories> 

<!--these fields below should also not change, unless you want to set a different custom metadataProfileId--> 

<customDataItems> 
<customData metadataProfileId="906921"> 
<xmlData> 
<metadata> 



<!-- these are textual fields, but note that in your metadata profile the 'event' and 'page' values are limited to one character--> 

<Event>1</Event> 
<Page>1</Page> 

<!-- 'rider' and 'horse' are unlimited textual files--> 

<Rider>TEST</Rider> 
<Horse>TEST</Horse> 

<!--'Disciplines' is a field the is chosen from a list of values, meaning that if you will not choose a value from the list the file will fail completely--> 

<Disciplines>Arabian</Disciplines> 

<!--this part below should also not change--> 
</metadata> 
</xmlData> 
</customData> 
</customDataItems> 
</item> 
</channel> 
</mrss> 

Example XML file without the "event " field with comments

The following is an example of an XML file without the 'Event' field. The fields that are necessary are the action and entryId. 

<!--
the row above and this part below should not change
-->
<mrss xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="ingestion.xsd">
<channel>
<item>
<action>update</action>
<!-- here you determine the entry ID you want to update -->
<entryId>0_bukomjmo</entryId>
<!--
name and description are textual values with little to none limitations (maybe just the length)
-->
<name>TEST</name>
<description>TEST</description>
<!--
only in the category part, write the categories by their accurate names. to show categories hierarchy, start with the highest one and put the > sign between them with no spaces. you can add or remove as much <category>XXX</category> fields as you wish. If the categories do not exist, like in the second example, they will be created
-->
<categories>
<category>Events>2014</category>
<category>Events>TEST</category>
</categories>
<!--
these fields below should also not change, unless you want to set a different custom metadataProfileId
-->
<customDataItems>
<customData metadataProfileId="906921">
<xmlData>
<metadata>
<!--
 these are textual fields, but note that in your metadata profile the 'event' and 'page' values are limited to one character
-->
<Page>1</Page>
<!--  'rider' and 'horse' are unlimited textual files -->
<Rider>TEST</Rider>
<Horse>TEST</Horse>
<!--
'Disciplines' is a field the is chosen from a list of values, meaning that if you will not choose a value from the list the file will fail completely
-->
<Disciplines>Arabian</Disciplines>
<!-- this part below should also not change -->
</metadata>
</xmlData>
</customData>
</customDataItems>
</item>
</channel>
</mrss>

    Important Note


When metadata is updated, the XML sent to the API has to be complete and include all existing fields. In other words, when you are updating custom metadata for entries, you need to include all metadata items in the XML file and not just the ones that you want to update.


For example, let's say you have 4 fields with the following information:

test1

test2

test3

{blank}


If you want to update field #4, you will need to retrieve all of the previous fields and then add the #4 content, as shown below:

xmlData:

<metadata>

<1>test1</1>

<2>test2</2>

<3>test3></3>

<4>addNewContentHere</4>

</metadata>

If you want to remove all the custom metadata fields, you will need to remove all the rows between <customDataItems> and it's closure </customDataItems>. 

Was this article helpful?
Thank you for your feedback!
User Icon

Thank you! Your comment has been submitted.

In This Article
Related Articles
Back to top

Never miss a thing!

Subscribe to our customer newsletter and our release notes updates, so you always get the best out of Kaltura.
Newsletter