Beispiel #1
0
        public static IEnumerable <Metadata> MetaList(IList <XElement> metaList)
        {
            if (metaList == null || metaList.Count == 0)
            {
                yield break;
            }

            foreach (var item in metaList)
            {
                switch (item.Name.LocalName)
                {
                case "oai_dc":
                    yield return(DublinCore.Decode(item));

                    break;

                case "provenance":
                    yield return(Provenance.Decode(item));

                    break;

                case "pan_simple":
                    yield return(PanSimple.Decode(item));

                    break;

                // TODO: Add format here

                default:
                    break;
                }
            }
        }
Beispiel #2
0
        public static Metadata Metadata(XElement metadata, string format)
        {
            if (metadata == null || string.IsNullOrEmpty(format))
            {
                return(null);
            }

            switch (format)
            {
            case "oai_dc":
                return(DublinCore.Decode(metadata));

            case "provenance":
                return(Provenance.Decode(metadata));

            case "pan_simple":
                return(PanSimple.Decode(metadata));

            // TODO: Add format here

            default: return(null);
            }
        }