I am trying to check for the content for a xml element but the compiler is not liking the following code
private string GetCriteriaString(XDocument document, ManagementPackView view) {
List<XElement> queryCriteriaCollection = (from qc in document.Root.Descendants("Criteria")
select qc).ToList();
string nodeValue;
foreach (XElement element in queryCriteriaCollection) {
XmlDocument xmlDocument = new XmlDocument();
XmlElement root = xmlDocument.CreateElement("Root");
root.InnerXml = element.ToString();
XmlNodeList queryParameters = root.GetElementsByTagName("Freeform"); //for freeform-based criteria
foreach (XmlNode node in queryParameters)
nodeValue = node.Attributes.GetNamedItem("Value");
if (nodeValue.Value == "")
{
}else
{
}
if (nodeValue.Value.StartsWith("$MPElement[") && nodeValue.alue.EndsWith("]$"))
{
}
else
{ //might be a GUID. need no conversion
}
return nodeValue.ToString() ;
}
Its the property I the values which I need to parse?
- <Criteria>
- <QueryCriteria xmlns="http://ift.tt/UlhdFK" Adapter="omsdk://Adapters/Criteria">
- <Criteria>
- <FreeformCriteria>
- <Freeform>
- <Criteria xmlns="http://ift.tt/1c1K19N">
- <Expression>
- <In>
<GenericProperty Path="$Context/Path[Relationship='WorkItem!System.WorkItemAssignedToUser' SeedRole='Source']$">Id</GenericProperty>
- <Values>
<Token>[me]</Token>
<Token>[mygroups]</Token>
</Values>
</In>
</Expression>
</Criteria>
</Freeform>
</FreeformCriteria>
</Criteria>
</QueryCriteria>
</Criteria>
No comments:
Post a Comment