{"id":22278668,"url":"https://github.com/rsm-hcd/common-cartridge","last_synced_at":"2025-10-13T17:31:03.417Z","repository":{"id":86692144,"uuid":"106690211","full_name":"rsm-hcd/Common-Cartridge","owner":"rsm-hcd","description":"Library encapsulating the XDT files provided by IMS to convert XML Common Cartridge files into structured classes","archived":false,"fork":false,"pushed_at":"2018-05-03T13:01:17.000Z","size":252,"stargazers_count":1,"open_issues_count":1,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-03T15:15:17.373Z","etag":null,"topics":["common-cartridge","dotnet-core","ims-basiclti","lti","parser","parsing"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rsm-hcd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2017-10-12T12:31:40.000Z","updated_at":"2021-02-10T03:39:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"0c39a2f8-0947-4ff9-b5c9-4dc8bffd7752","html_url":"https://github.com/rsm-hcd/Common-Cartridge","commit_stats":null,"previous_names":["rsm-hcd/common-cartridge"],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rsm-hcd%2FCommon-Cartridge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rsm-hcd%2FCommon-Cartridge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rsm-hcd%2FCommon-Cartridge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rsm-hcd%2FCommon-Cartridge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rsm-hcd","download_url":"https://codeload.github.com/rsm-hcd/Common-Cartridge/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":236376222,"owners_count":19139157,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["common-cartridge","dotnet-core","ims-basiclti","lti","parser","parsing"],"created_at":"2024-12-03T15:15:26.678Z","updated_at":"2025-10-13T17:30:58.025Z","avatar_url":"https://github.com/rsm-hcd.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Common Cartridge Dotnet core parser\n\nDotnet Core Package for parsing LTI \u0026 Common Cartridge XML files into C# classes. XDT files downloaded from the [IMS Global Technical Resources](https://www.imsglobal.org/technical-resources) page\n\n## Installation\n\nInstall from the Nuget repository [https://www.nuget.org/packages/AndcultureCode.CommonCartridge.Parser/]\n\n## Usage\n\n### Parsing a cartridge manifest file\n\n```\nusing CommonCartridge.Core;\nusing CommonCartridge.Core.Constants;\nusing CommonCartridge.Core.Interfaces;\n\nvar fileContent = File.ReadAllText(filename);\nvar parser = new Parser();\nvar versionParser = new VersionParser();\n\n// Check Version\nvar version = versionParser.GetSchemaVersion(fileContent);\n\nif (version == Versions.VERSION_1_0)\n{\n\t// v0 variable contains a fully structured class representing the Common Cartridge 1.0 manifest\n\tvar v0 = parser.FromCCXml\u003cCommonCartridge.Core.Models.v1_0.ManifestType\u003e(fileContent, directoryPath);\n} else if (version == Versions.VERSION_1_1)\n{\n\t// v1 variable contains a fully structured class representing the Common Cartridge 1.1 manifest\n\tvar v1 = parser.FromCCXml\u003cCommonCartridge.Core.Models.v1_1.ManifestType\u003e(fileContent, DirectoryPath);\n} else if (version == Versions.VERSION_1_2)\n{\n\t// v2 variable contains a fully structured class representing the Common Cartridge 1.2 manifest\n\tvar v2 = parser.FromCCXml\u003cCommonCartridge.Core.Models.v1_2.ManifestType\u003e(fileContent, DirectoryPath);\n} else if (version == Versions.VERSION_1_3)\n{\n\t// v3 variable contains a fully structured class representing the Common Cartridge 1.3 manifest\n\tvar v3 = parser.FromCCXml\u003cCommonCartridge.Core.Models.v1_3.ManifestType\u003e(fileContent, DirectoryPath);\n}\n```\n\n### Parsing an LTI file\n\n```\nusing CommonCartridge.Core;\nusing CommonCartridge.Core.Constants;\nusing CommonCartridge.Core.Interfaces;\n\nvar fileContent = File.ReadAllText(filename);\nvar parser = new Parser();\nvar versionParser = new VersionParser();\n\n// Check Version\nvar version = versionParser.GetSchemaVersion(fileContent, \"blti\");\n\nif (version == Versions.VERSION_1_0)\n{\n\t// v0 variable contains a fully structured class representing the LTI 1.0 file\n\tvar v0 = _parser.FromXml\u003cCommonCartridge.Core.Models.v1_0.CartridgeBasicLTILinkType\u003e(fileContent);\n} else if (version == Versions.VERSION_1_1)\n{\n\t// v1 variable contains a fully structured class representing the LTI 1.1 file\n\tvar v1 = _parser.FromXml\u003cCommonCartridge.Core.Models.v1_1.CartridgeBasicLTILinkType\u003e(fileContent);\n} else if (version == Versions.VERSION_1_2)\n{\n\t// v1_1 variable contains a fully structured class representing the LTI 1.1.2 file\n\tvar v1_1 = _parser.FromXml\u003cCommonCartridge.Core.Models.v1_1_1.CartridgeBasicLTILinkType\u003e(fileContent);\n}\n```\n\n## Interfaces\n\n### IParser\n\nMethod | Return | Description\n----------|------|------------\nFromFile\u0026lt;T\u0026gt; | ParserResult\u003cT\u003e | Same as FromXml, but also loads file from specified path before parsing\nFromXml\u0026lt;T\u0026gt; | ParserResult\u003cT\u003e | Loads XML into XDocument and deserializes to provided class\nFromCCArchive\u0026lt;T\u0026gt; | ParserResult\u003cT\u003e | Verifies extension of archive, attemps to unzip into a temp directory, and looks for an imsmanifest.xml file to pass to FromCCFile\nFromCCFile\u0026lt;T\u0026gt; | ParserResult\u003cT\u003e | Same as FromCCXml, but also loads file from specified path before parsing\nFromCCXml\u0026lt;T\u0026gt; | ParserResult\u003cT\u003e | Loads XML into XDocument and deserializes to provided CC class\n\n### IVersionParser\n\nMethod | Return | Description\n----------|------|------------\nGetSchemaVersionFromFile | string | Same as GetSchemaVersion, but also loads file from specified path before parsing\nGetSchemaVersion | string | Loads XML into XDocument attempts to read version string from XML schemaversion attribute. Second param (prefix) is optional, will attempt to read the version from a custom namespace. Default empty.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frsm-hcd%2Fcommon-cartridge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frsm-hcd%2Fcommon-cartridge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frsm-hcd%2Fcommon-cartridge/lists"}