Hi
I am trying to retrieve Virtual Machines object while using 2 conditions and I would like to implement (AND) condition.
it's XPATH expression
and this is the list of XPath expression that I already tried to use (without success):
<code>
var XPath_query = "xpath:child::config/child::template[ . = true() ] and child::sdkConnection/child::about/child::instanceUuid[ . = '52980cec-f342-41cd-df32-a8f7d7a232d30' ]";
var XPath_query = "xpath:child::config/child::template[ . = true() ] and child::sdkConnection/child::about/child::instanceUuid[contains(.,'52980cec-f342-41cd-df32-a8f7d7a232d30')]";
var XPath_query = "xpath:config/template[ . = true() ] and sdkConnection/about/instanceUuid[ contains(.,'52980cec-f342-41cd-df32-a8f7d7a232d30') ]";
var XPath_query = "xpath:config/template[ . = true() ] and sdkConnection/about/instanceUuid[ contains(string(.),'52980cec-f342-41cd-df32-a8f7d7a232d30') ]";
var XPath_query = "xpath://[ config/template = true() and contains(string(sdkConnection/about/instanceUuid),'52980cec-f342-41cd-df32-a8f7d7a232d30') ]";
var XPath_query = "xpath://[ config/template = true() and contains(sdkConnection/about/instanceUuid,'52980cec-f342-41cd-df32-a8f7d7a232d30') ]";
var XPath_query = "xpath:[ config/template/. = true() and contains(sdkConnection/about/instanceUuid/.,'52980cec-f342-41cd-df32-a8f7d7a232d30') ]";
var XPath_query = "xpath://[ config/template/. = true() and contains(sdkConnection/about/instanceUuid/.,'52980cec-f342-41cd-df32-a8f7d7a232d30') ]";
System.log(XPath_query);
var VcVirtualMachine_Array = Server.findAllForType("VC:VirtualMachine",XPath_query);
System.log("Array Length: " + VcVirtualMachine_Array.length);
</code>
basically what I am trying to achieve is the following:
config/template should be true value
and
sdkConnection/about/instanceUuid should be equal to value of 52980cec-f342-41cd-df32-a8f7d7a232d30
thanks in advanced for the assistance