Extract XML based on attribute name
I have xml with the following structure. Want to extract only title information from the following. For this I use the extract function. But in order to extract only "Name" what should my xml path be? I've tried everything. Please help fill out the request for this.
<Employee>
<Basics>
<Attribute Name="Scope">LOCAL</Attribute>
<Attribute Name="Name">Narendra</Attribute>
<Attribute Name="Id">12345</Attribute>
<Attribute Name="Type">EMPLOYEE</Attribute>
<Attribute Name="Revision"/>
</Basics>
</Employee>
My request looks like this.
SELECT
extract(value(N), 'Attribute/text()').getStringVal() AS Emp_Name
FROM Employee A,
table(xmlsequence(extract(A.XML_INFO, '/Employee/Basics/Attribute'))) N
+3
source to share