XPath command
Posted: Tue Jul 21, 2020 6:03 pm
Is it possible to get value of 'Password" which is 'P@ssword1' from this XML text using XPath command? I was able to get the entire string using following command:
Evaluate Query //configuration/connectionStrings/add[@name="UDS"] on XML file $PROGRAMDATAFOLDER$\Web\Web.config, get result into variable UDSAppPWD as type Full XML String
Wonder if there is a better way to get password value.
<configSections>
<connectionStrings>
<clear />
<add name="UDS" connectionString="Server=localhost\DataED;Database=UDS;User Id=UDS_App;Password=P@ssword1" providerName="System.Data.SqlClient" />
<add name="UDSEntities" connectionString="metadata=res://*/SmsModel.csdl|res://*/SmsModel.ssdl|res://*/SmsModel.msl;provider=System.Data.SqlClient;provider connection string="Server=localhost\DataED;Database=UDS;User Id=UDS_App;Password=P@ssword1;"" providerName="System.Data.EntityClient" />
<add name="UDSAdmin" connectionString="Server=localhost\DataED;Database=UDS;User Id=UDS_Admin;Password=P@ssword1" providerName="System.Data.SqlClient" />
<!-- Used by ASP.NET Identity -->
</connectionStrings>
...
</configSections>
Evaluate Query //configuration/connectionStrings/add[@name="UDS"] on XML file $PROGRAMDATAFOLDER$\Web\Web.config, get result into variable UDSAppPWD as type Full XML String
Wonder if there is a better way to get password value.
<configSections>
<connectionStrings>
<clear />
<add name="UDS" connectionString="Server=localhost\DataED;Database=UDS;User Id=UDS_App;Password=P@ssword1" providerName="System.Data.SqlClient" />
<add name="UDSEntities" connectionString="metadata=res://*/SmsModel.csdl|res://*/SmsModel.ssdl|res://*/SmsModel.msl;provider=System.Data.SqlClient;provider connection string="Server=localhost\DataED;Database=UDS;User Id=UDS_App;Password=P@ssword1;"" providerName="System.Data.EntityClient" />
<add name="UDSAdmin" connectionString="Server=localhost\DataED;Database=UDS;User Id=UDS_Admin;Password=P@ssword1" providerName="System.Data.SqlClient" />
<!-- Used by ASP.NET Identity -->
</connectionStrings>
...
</configSections>