Using properties in an xpath
hi,
i have an xpath that runs perfectly when i hardcode the computer name below. however if i substitute the value with a property it does not resolve.
can anyone specify the correct syntax to ensure i get the resolved property when installing:-
Working:-
/MachineInventory/Machines/Machine[@name="MyPCName"]/Attributes/Attribute[@name="City"]
Not working:-
/MachineInventory/Machines/Machine[@name="[COMPUTERNAME]"]/Attributes/Attribute[@name="City"]
what do i need to add to [COMPUTERNAME] to ensure it gets reolved?????
i have an xpath that runs perfectly when i hardcode the computer name below. however if i substitute the value with a property it does not resolve.
can anyone specify the correct syntax to ensure i get the resolved property when installing:-
Working:-
/MachineInventory/Machines/Machine[@name="MyPCName"]/Attributes/Attribute[@name="City"]
Not working:-
/MachineInventory/Machines/Machine[@name="[COMPUTERNAME]"]/Attributes/Attribute[@name="City"]
what do i need to add to [COMPUTERNAME] to ensure it gets reolved?????
0 Comments
[ + ] Show comments
Answers (12)
Please log in to answer
Posted by:
aogilmor
17 years ago
Posted by:
misk
17 years ago
thx Owen, but i am afraid no joy with formatting either.
I fear i may have to use a custom action which is not what i had hoped.
with that in mind does anyone have a snippet of code that executes an xpath query and gives me the ability to store the returned value in a property so that i can use it in a component condition?
I fear i may have to use a custom action which is not what i had hoped.
with that in mind does anyone have a snippet of code that executes an xpath query and gives me the ability to store the returned value in a property so that i can use it in a component condition?
Posted by:
rakesh.kumar
17 years ago
Posted by:
fuz_kitten
17 years ago
/MachineInventory/Machines/Machine[\[]@name="[ComputerName]"[\]]/Attributes/Attribute[\[]@name="City"[\]]
From Formatted
If a substring of the form [\x] is found, it is replaced by the character x , where x is one character, without any further processing. Only the first character after the backslash is kept; everything else is removed. For example, to include a literal left bracket ([), use [\[]. The text [\[]Bracket Text[\]] resolves to [Bracket Text].
What does the log resolve [ComputerName] to?
From Formatted
If a substring of the form [\x] is found, it is replaced by the character x , where x is one character, without any further processing. Only the first character after the backslash is kept; everything else is removed. For example, to include a literal left bracket ([), use [\[]. The text [\[]Bracket Text[\]] resolves to [Bracket Text].
What does the log resolve [ComputerName] to?
Posted by:
misk
17 years ago
thx for the help.
when looking at the log it seems as if the CA ISXmlAppSearch does not attempt to resolve the string whatsoever.
for example if i set the Element column of the ISXmlLocator table to any of the following it does not get resolved and shows up character for character in the lof.
Value in table What appears in log as element value to look for
[ComputerName] [ComputerName]
[%ComputerName%] [%ComputerName%]
[\[]ComputerName] [\[]ComputerName]
[[ALLUSERS]] [[ALLUSERS]]
It is as if no attempt is made to resolve any part of the expression when using the xml app search.
Can anyone confirm this?
when looking at the log it seems as if the CA ISXmlAppSearch does not attempt to resolve the string whatsoever.
for example if i set the Element column of the ISXmlLocator table to any of the following it does not get resolved and shows up character for character in the lof.
Value in table What appears in log as element value to look for
[ComputerName] [ComputerName]
[%ComputerName%] [%ComputerName%]
[\[]ComputerName] [\[]ComputerName]
[[ALLUSERS]] [[ALLUSERS]]
It is as if no attempt is made to resolve any part of the expression when using the xml app search.
Can anyone confirm this?
Posted by:
fuz_kitten
17 years ago
Posted by:
jmcfadyen
17 years ago
Posted by:
misk
17 years ago
Posted by:
misk
17 years ago
Posted by:
jmcfadyen
17 years ago
//configuration/appSettings/add[\[]@key='azmanStore'[\]]/@value
//FormManagement/ReplaceItems/ReplaceItem/NewUrl
//appSettings/add[\[]@key='AUDIT_QUEUE'[\]]/@value
//MonitoredProcessStartInfo[\[]ProcessName='ISS RuleBase'[/]]/EnvironmentVariables/Parameter[\[]@key='SSAMSQBIN'[/]]/@value
//configuration/applicationSettings/SIS.Framework.Auditing.MsmqDistributor.Properties.Settings/setting[\[]@name='AuditQueuePath'[\]]/value
//FormManagement/ReplaceItems/ReplaceItem/NewUrl
//appSettings/add[\[]@key='AUDIT_QUEUE'[\]]/@value
//MonitoredProcessStartInfo[\[]ProcessName='ISS RuleBase'[/]]/EnvironmentVariables/Parameter[\[]@key='SSAMSQBIN'[/]]/@value
//configuration/applicationSettings/SIS.Framework.Auditing.MsmqDistributor.Properties.Settings/setting[\[]@name='AuditQueuePath'[\]]/value
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.