3 added 217 characters in body
source | link

it seems, you wantTo filter out keywords used in content data, you need to read the schema of the component and go through all the content fields.

if field is using a particular category(you mentioned as, add it to a groupcollection object (string[] CatIDs in the code below). you just need to filterand use it for filtering the XMLxml results.

you can try the below code:

                            XElementstring[] xmlData;
CatIDs; // collection of the categories used in conent fields
                   xmlData = document.Root;
       XElement xmlData;
                    XNamespace ns =      xmlData = document.GetDefaultNamespace();Root;
                            stringXNamespace fieldNamens = "tcmItem";xmlData.GetDefaultNamespace();
                            string catIDfieldName = "tcm:89-7063-512";"tcmItem";

//filtering out keywords form the category tcm:89-7063-512
                            var results = xmlData.Descendants(ns + fieldName).Where(i => CatIDs.Contains( i.Attribute("OrgItemID").Value != catID));

the variable results shall contain the filtered elements.

PS: I have not run this code, adjustments could be needed

it seems, you want filter out keywords of a particular category(you mentioned as a group). you just need to filter the XML results.

you can try the below code:

                            XElement xmlData;
                            xmlData = document.Root;
                            XNamespace ns = xmlData.GetDefaultNamespace();
                            string fieldName = "tcmItem";
                            string catID = "tcm:89-7063-512";
//filtering out keywords form the category tcm:89-7063-512
                            var results = xmlData.Descendants(ns + fieldName).Where(i => i.Attribute("OrgItemID").Value != catID);

the variable results shall contain the filtered elements.

PS: I have not run this code, adjustments could be needed

To filter out keywords used in content data, you need to read the schema of the component and go through all the content fields.

if field is using a category, add it to a collection object (string[] CatIDs in the code below). and use it for filtering the xml results.

you can try the below code:

                            string[] CatIDs; // collection of the categories used in conent fields
                            XElement xmlData;
                            xmlData = document.Root;
                            XNamespace ns = xmlData.GetDefaultNamespace();
                            string fieldName = "tcmItem";

//filtering out keywords form the category tcm:89-7063-512
                            var results = xmlData.Descendants(ns + fieldName).Where(i => CatIDs.Contains( i.Attribute("OrgItemID").Value));

the variable results shall contain the filtered elements.

PS: I have not run this code, adjustments could be needed

2 added 94 characters in body
source | link

As you mentionedit seems, you want filter out keywords only fromof a particular category(you mentioned as a group). you just need to filter the XML results.

you can try the below code:

                            XElement xmlData;
                            xmlData = document.Root;
                            XNamespace ns = xmlData.GetDefaultNamespace();
                            string fieldName = "tcmItem";
                            string catID = "tcm:89-63327063-512";
//filtering out keywords form the category tcm:89-7063-512
                            var results = xmlData.Descendants(ns + fieldName).Where(i => i.Attribute("OrgItemID").Value ==!= catID);

the variable results shall contain the filtered elements.

PS: I have not run this code, adjustments could be needed

As you mentioned, you want keywords only from a particular category(you mentioned as a group). you just need to filter the XML results.

you can try the below code:

                        XElement xmlData;
                        xmlData = document.Root;
                        XNamespace ns = xmlData.GetDefaultNamespace();
                        string fieldName = "tcmItem";
                        string catID = "tcm:89-6332-512";
                        var results = xmlData.Descendants(ns + fieldName).Where(i => i.Attribute("OrgItemID").Value == catID);

the variable results shall contain the filtered elements.

PS: I have not run this code, adjustments could be needed

it seems, you want filter out keywords of a particular category(you mentioned as a group). you just need to filter the XML results.

you can try the below code:

                            XElement xmlData;
                            xmlData = document.Root;
                            XNamespace ns = xmlData.GetDefaultNamespace();
                            string fieldName = "tcmItem";
                            string catID = "tcm:89-7063-512";
//filtering out keywords form the category tcm:89-7063-512
                            var results = xmlData.Descendants(ns + fieldName).Where(i => i.Attribute("OrgItemID").Value != catID);

the variable results shall contain the filtered elements.

PS: I have not run this code, adjustments could be needed

1
source | link

As you mentioned, you want keywords only from a particular category(you mentioned as a group). you just need to filter the XML results.

you can try the below code:

                        XElement xmlData;
                        xmlData = document.Root;
                        XNamespace ns = xmlData.GetDefaultNamespace();
                        string fieldName = "tcmItem";
                        string catID = "tcm:89-6332-512";
                        var results = xmlData.Descendants(ns + fieldName).Where(i => i.Attribute("OrgItemID").Value == catID);

the variable results shall contain the filtered elements.

PS: I have not run this code, adjustments could be needed