public string BuildExpression(enuIOPESearchBy filter) { switch (filter) { case enuIOPESearchBy.PARAM_DESC: return("/" + DamlConstants.DEFAULT_NS + ":" + DamlConstants.OUTPUT + "/" + DamlConstants.PROFILE_PARAM_DESC); case enuIOPESearchBy.PARAM_NAME: return("/" + DamlConstants.DEFAULT_NS + ":" + DamlConstants.OUTPUT + "/" + DamlConstants.PROFILE_PARAM_DESC + "[@" + DamlConstants.RDF_ID + "]" + "/" + DamlConstants.PROFILE_PARAM_NAME); case enuIOPESearchBy.REFERS_TO: return("/" + DamlConstants.DEFAULT_NS + ":" + DamlConstants.OUTPUT + "/" + DamlConstants.PROFILE_PARAM_DESC + "[@" + DamlConstants.RDF_ID + "]" + "/" + DamlConstants.PROFILE_REFERS_TO); default: throw new ArgumentException("Invalid filter value"); } ; }
public string BuildExpression(enuIOPESearchBy filter, string strSearchKey) { string strXPath = ""; switch (filter) { case enuIOPESearchBy.PARAM_DESC: strXPath = BuildExpression(filter); strXPath += "[@" + DamlConstants.RDF_ID + "='" + strSearchKey + "']"; return(strXPath); case enuIOPESearchBy.PARAM_NAME: strXPath = BuildExpression(filter); strXPath += "[." + "='" + strSearchKey + "']"; return(strXPath); case enuIOPESearchBy.REFERS_TO: strXPath = BuildExpression(filter); strXPath += "[@" + DamlConstants.RDF_RESOURCE + "='" + strSearchKey + "']"; return(strXPath); default: throw new ArgumentException("Invalid filter value"); } ; }