public virtual void testObjectTagsMetadata() { KElement tagMap = rl.appendElement(METADATA_MAP); tagMap.setXMLComment("This tagmap specifies The path for the NMTOKEN \"ObjectTag\""); tagMap.setAttribute("Name", "ObjectTags"); tagMap.setAttribute(AttributeName.VALUEFORMAT, "%s"); tagMap.setAttribute(AttributeName.CONTEXT, "Object"); tagMap.setAttribute(AttributeName.DATATYPE, "NMTOKEN"); tagMap.setAttribute(AttributeName.VALUETEMPLATE, "AnyName1"); tagMap.addNameSpace("TIFFXMP", "http://ns.adobe.com/tiff/1.0"); string[] ss = new string[] { "Acme", "Bcme", "Ccme" }; for (int i = 0; i < ss.Length; i++) { string s = ss[i]; KElement tagSet = tagMap.appendElement(EXPR); tagSet.setAttribute("Name", "AnyName1"); tagSet.setAttribute("Value", s); JDFStringEvaluation eval = (JDFStringEvaluation)tagSet.appendElement(ElementName.STRINGEVALUATION); eval.setAttribute("Path", "TIFFXMP:Make"); eval.setRegExp("(.*)" + s + "(.*)"); eval.setXMLComment("Any acme camera is mapped to \"" + s + "\""); } JDFColorSpaceConversionParams csp = (JDFColorSpaceConversionParams)root.addResource(ElementName.COLORSPACECONVERSIONPARAMS, EnumUsage.Input); csp.setXMLComment("This ColorSpaceConversionParams treats Acme and Bcme cameras the same but differentiates for Ccme"); JDFColorSpaceConversionOp op1 = csp.appendColorSpaceConversionOp(); op1.setAttribute("ObjectTags", "Acme Bcme"); JDFColorSpaceConversionOp op2 = csp.appendColorSpaceConversionOp(); op2.setAttribute("ObjectTags", "Ccme"); doc.write2File(sm_dirTestDataTemp + "objectTags.jdf", 2, false); }
/// /// <summary> * Get all ColorSpaceConversionOp from the current element /// * </summary> /// * <returns> Collection<JDFColorSpaceConversionOp> </returns> /// public virtual ICollection <JDFColorSpaceConversionOp> getAllColorSpaceConversionOp() { List <JDFColorSpaceConversionOp> v = new List <JDFColorSpaceConversionOp>(); JDFColorSpaceConversionOp kElem = (JDFColorSpaceConversionOp)getFirstChildElement(ElementName.COLORSPACECONVERSIONOP, null); while (kElem != null) { v.Add(kElem); kElem = (JDFColorSpaceConversionOp)kElem.getNextSiblingElement(ElementName.COLORSPACECONVERSIONOP, null); } return(v); }