This is my XML file
<?xml version="1.0" encoding="UTF-8"?>
<Environment xmlns="http://schemas.dmtf.org/ovf/environment/1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:oe="http://schemas.dmtf.org/ovf/environment/1" xmlns:ve="http://www.vmware.com/schema/ovfenv" oe:id="" ve:vCenterId="">
<PlatformSection>
<Kind>VMware ESXi</Kind>
<Version>7.0.0</Version>
<Vendor>VMware, Inc.</Vendor>
<Locale>en</Locale>
</PlatformSection>
<PropertySection>
<Property oe:key="test" oe:value="test123"/>
<Property oe:key="testing" oe:value="testing123"/>
</PropertySection>
<ve:EthernetAdapterSection>
<ve:Adapter ve:mac="" ve:network="" ve:unitNumber="7"/>
</ve:EthernetAdapterSection>
</Environment>
I want to parse it using XMLLint and fetch all "oe:key" and "oe:value"
I tried following commands:
xmllint --xpath "string(//PlatformSection)" file1.xml
xmllint --xpath "string(//Environment)" file1.xml
But both are returning blank. Similarly, I tried for Property and PropertySection and getting a blank response.