create table xtest01(col1 xmltype);
insert into xtest01 values ('<car><model>Audi TT</model></car>');
insert into xtest01 values ('<car model="BMW X5"/>');
-- I know how to get Audi TT:
select x.col1.extract('//car/model/text()').getStringVal() from xtest01 x;
-- But how to get BMW X5?
select x.col1.extract('//car/@model').getStringVal() from xtest01 x;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With