8 Replies Latest reply on Dec 5, 2013 7:03 AM by dkellymm

    Setting a field field with XMP value

    dkellymm Level 1

      Hello, I'm attempting to set a field value equal to a value in the document's XMP metadata using a custom Javascript field calculation. It's not working as expected however. What am I missing?

       

      var meta = event.target.metadata;

      var xml = new XML(meta);

      var nsrdf = new Namespace("http://www.w3.org/1999/02/22-rdf-syntax-ns#");

      var nsdc = new Namespace("http://purl.org/dc/elements/1.1/");

      var format = "unknown";

      try {

          format = xml.nsrdf::RDF.nsrdf::Description.nsdc::format;

      } catch(e) {}

      event.value = format;