Hi Senaka, Given below is all we have as a reference to plan/execute tests on Xpath query feature in G-reg. (Taken from: https://docs.google.com/a/wso2.com/document/d/1XdEHku1zdYz2_4oYIBg_YZ0bGIZgk0SGgoyHxAedng4/edit )
========================================================================================================================================== *Can pass Xapth expressions to executeQuery method (i.e can search for services /policies from xpath expressions) i.e //<HUMAN_READABLE_NAME> //<HUMAN_READABLE_NAME>[<SEARCH CRITERIA>] //<HUMAN_READABLE_NAME>/<ASSOCIATION_NAME OR CHILD RESOURCE OR COLLECTION NAME> //<HUMAN_READABLE_NAME>[<SEARCH CRITERIA>]/<ASSOCIATION_NAME OR CHILD RESOURCE OR COLLECTION NAME> //<HUMAN_READABLE_NAME>[<SEARCH CRITERIA>]/<ASSOCIATION_NAME OR CHILD RESOURCE OR COLLECTION NAME>[<SEARCH CRITERIA>] //<HUMAN_READABLE_NAME>[<SEARCH CRITERIA>]/<ASSOCIATION_NAME OR CHILD RESOURCE OR COLLECTION NAME>[<SEARCH CRITERIA>]/<ASSOCIATION_NAME OR CHILD RESOURCE OR COLLECTION NAME>[<SEARCH CRITERIA>] /<RESOURCE_OR_COLLECTION_NAME_UNDER_ROOT>/... //<ANY_RESOURCE_OR_COLLECTION_NAME>/...* ================================================================================================================================================= Can anyone get any idea by looking at the above? We had to spend time unnecessarily to go through code to figure out what you actually meant by above key words. We did the following test first. 1. "Assuming" the above *HUMAN_READABLE_NAME refers to *human readable media types*, defined a new human readable media type in mime.mappings file e.g:- application/vnd.wso2-service+xml web 2. Ran the following test public void testXpathQuery() throws RegistryException { Map parameters = new HashMap(); parameters.put("query", "//web"); parameters.put("mediaType", "application/vnd.wso2.xpath.query"); Resource result = registry.executeQuery(null, parameters); System.out.println(result.getId()); String[] paths = (String[]) result.getContent(); for (String path : paths) { System.out.println("path is " + path); } } * This returned all services. e.g:- /_system/governance/trunk/services/org/wso2/carbon/service/Axis2Service We are stuck after this test. How should we proceed with SEARCH CRITERIA and other options? We tried a lot of Xpath combinations but still unable to figure out and not sure what we are observing is the expected behavior. We cannot test anything based on assumptions. I'm sorry, but hours of our time would have been saved if you gave at least a simple example at first place. I do not think anybody can get any idea by looking at what you have given above. We are badly running out of time and we need to move into the other product testing soon. We do not have time to play around any trial'n error scenarios. Please send us an example ASAP. Thanks! Charitha
_______________________________________________ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev