I'm in the process of retreiving some data from a xml file, it is actually a SSIS package file (dtsx). I've read about using
xmllint
, however I'm having a hard time retrieving what I want. I'd like to ask some helps from folks here. This is what my xml looks like:
8
I'm looking to get the value "**8**" out of this line
8
so, what I did was to issue a command
xmllint --xpath "//*[local-name()='Executable']/*[local-ame()='Property']/text()" HardestNestedWorkflow2_latest.xml
.. and it was good, I was able to extract the value "8"
Now, I wanted to extract the value
Data Source=ADMIN-8DF005D47;Initial Catalog=AdventureWorks;Provider=SQLNCLI11;Integrated Security=SSPI;Application Name=SSIS-HardestNestedWorkflow2-{A32A68DF-3D53-4057-AF80-1B8D524F82BC}ADMIN-8DF005D47.AdventureWorks;Auto Translate=False;
I issued this statement
xmllint --xpath "//*[local-name()='Executable']/*[local-name()='ConnectionManagers']/*[local-name()='ConnectionManager']/*[local-name()='ObjectData']/*[local-name()='ConnectionManager']" HardestNestedWorkflow2_latest.xml
and it returned this
how can I omit the tags DTS:ConnectionManager DTS:ConnectionString
? I'm sorry I'm not much knowledgeable on using xmllint
.
Thanks in Advance
Asked by Kelvin
(3 rep)
Feb 12, 2020, 07:29 AM
Last activity: Feb 12, 2020, 08:43 AM
Last activity: Feb 12, 2020, 08:43 AM