First, figure out the correct query to return “DefaultWebSite” from this:
<location path="DefaultWebSite">
Then getting the correct site node would be something like this:
child nodes whose (node name of it = “site” AND attribute “name” of it = ()) of selects (“cionfiguration/system.applicationHost/sites”) of xml document of file “some XML file name”
Now as I am enumerating through the sites (DefaultWebSite, site1 and site2) I may need to reference the corresponding location node which has a path name that equates to the site name (DefaultWebSite, site1 OR site2)
so my relevance code for getting all of the site names is:
(node value of attribute “name” of it) of child nodes whose (node name of it = “site”) of selects (“configuration/system.applicationHost/sites”) of xml document of
some XML file name
so how would I be able to reference the site name that i am currently on in order to get the correct location node because if I use the folloiwng
select (“configuration/location”) whose (node value of attribute “path” of it =
it
) … where the highlighted blue text would be the reference to the site name.
Are you trying to get all location nodes, or a specific location node?
The only way I know how to do this is basically with single recursion. There is probably a better way, but the following should work:
selects (“configuration/location”) whose (((";" & it & “;”) of concatenation “;” of (node value of attribute “name” of it) of child nodes whose (node name of it = “site”) of selects (“configuration/system.applicationHost/sites”) of xml document of (some XML file name)) contains ((";" & it & “;”) of node value of attribute “path” of it)) of xml document of (some XML file name)
I’m cheating and using concat to convert from plural to singular, and this code is also not very efficient and will get slower exponentially based upon the number of location nodes. There is probably a better way to do this.
Yes I am looking at a specific location node based especially if the site node does not contain information I am looking for. I know this isa little dificul to do, but only working with TEM relevance language for ~ 6 months I knew there are much wiser relevance gurus out there.
I am working on a similar problem and used your example as reference. I am trying to retrieve the physical path associated to all websites (refered by the attribute “physicalPath”). But I am unable to list them properly. This is the statement I am using.
(node value of attribute “physicalPath” of it) of child node of child node of child nodes whose (node name of it as lowercase = “site”) of selects (“configuration/system.applicationHost/sites”)
of xml document of file “applicationHost.config” of folder “inetsrv/config” of system x64 folder
I am getting this error message
Current Selection Evaluates To:
E:\Public\Web\Wellpoint
Error: Singular expression refers to non-unique object.
I tried changing singular/plural forms but to no use. I’ve also attached the xml file I am fighting with here.
I am stuck on this for 3 days now and Your advice is much appreciated.
(node values of attributes “physicalPath” of it) of child nodes of child nodes of child nodes whose (node name of it as lowercase = “site”) of selects (“configuration/system.applicationHost/sites”)
of xml document of file “applicationHost.config” of folder “inetsrv/config” of system x64 folder