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>
XPath command
-
- Site Admin
- Posts: 5361
- Joined: Sun Aug 22, 2010 4:28 am
Re: XPath command
You may use the following query in combination with "Result Type= Node Value":
//configSections/connectionStrings/add[@name="UDS"]/@connectionString
This will restrict the returned value to:
"Server=localhost\DataED;Database=UDS;User Id=UDS_App;Password=P@ssword1"
But you can't get just the password, because there isn't any password value. Password is part of value assigned with "connectionString".
//configSections/connectionStrings/add[@name="UDS"]/@connectionString
This will restrict the returned value to:
"Server=localhost\DataED;Database=UDS;User Id=UDS_App;Password=P@ssword1"
But you can't get just the password, because there isn't any password value. Password is part of value assigned with "connectionString".
Francesco Toscano
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
Who is online
Users browsing this forum: No registered users and 73 guests