China Jan 2008 Shanghai } var xmpDict: TIEDictionary; // Dict containing image XMP data navDict: TIEDictionary; // Dict to navigate XML structure list: TObjectList; i: integer; begin ImageEnView1.IO.LoadFromFile( 'D:\XMP_Data_202112.JPG' );
// Get XMP xmpDict := ImageEnView1.IO.Params.Dict.GetDictionary('XMP');
// Output all entries of dc:subject->rdf:Bag into "memo1" navDict := xmpDict.GetDictionary('dc:subject', True); navDict := navDict.GetDictionary('#content', false); navDict := navDict.GetDictionary('rdf:Bag', false); navDict := navDict.GetDictionary('#content', false); list := navDict.GetList('rdf:li', false); for i := 0 to list.Count - 1 do begin navDict := TIEDictionary(list[i]).GetDictionary('#content', false); memo1.lines.add( navDict.GetString('#text', false) ); end; end;
// Parse all DictionaryEntries from XML file // Download file from: www.imageen.com/files/UnitTestFiles/XML_TEST.xml { SAMPLE:
absolute add ancestor anchor begin ... } var ss : TStringList; xmlDict: TIEDictionary; // Dict to parse source XML navDict: TIEDictionary; // Dict to navigate XML structure list: TObjectList; i: integer; begin ss := TStringList.Create; xmlDict := TIEDictionary.Create(); ss.LoadFromFile('D:\XML_TEST.xml'); xmlDict.parse( ss.Text );
// Output all entries of Proofreader->Rules->DictionaryEntries into "memo1" navDict := xmlDict.GetDictionary('Proofreader', false); navDict := navDict.GetDictionary('#content', false); navDict := TIEDictionary(navDict.GetList('Rules', false)[0]); navDict := navDict.GetDictionary('#content', false); navDict := navDict.GetDictionary('DictionaryEntries', false); navDict := navDict.GetDictionary('#content', false); list := navDict.GetList('Entry', false); for i := 0 to list.Count - 1 do begin navDict := TIEDictionary(list[i]).GetDictionary('#content', false); memo1.lines.add( navDict.GetString('#text', false) ); end;