I have TCM URI of a Schema, is there any way to get the Schema object from that?
I have tried some code but that only returns the XML of the Schema, I don't know how I can convert it to the Schema object. If I get the Schema object then I can access Schema.NamespaceUri
to get the UUID of that Schema.
I am trying the following code but, it only returns the Schema XML.
var resultXml = client.GetListXml(
publicationId,
new RepositoryItemsFilterData
{
ItemTypes = new[] { ItemType.Schema },
Recursive=true
}
).Elements().Where(schemaElem => schemaElem.Attribute("ID").Value==schemaID);
When I use the following method, it throws an error
var filter = new RepositoryItemsFilterData
{
SchemaPurposes = new[] { SchemaPurpose.Metadata },
Recursive = true,
ItemTypes = new[] { ItemType.Schema }
};
var result = client.GetList(schemaID, filter);
Unexpected list type:
Tridion.ContentManager.Data.ContentManagement.RepositoryItemsFilterData.