2016-08-30 44 views
0

我有以下XML文件阅读嵌套的标签XML文件中的蜂巢

<rec><name><fname>Ravi</fname><lname>kumar</lname></name> 
<age>25</age><contact> 
<email><personal>[email protected]</personal> 
<official>[email protected]</official></email> 
<phone><mobile>12345</mobile> 
<office>12346</office> 
<residence>12347</residence></phone></contact></rec> 

如何读取嵌套的标签!我是新来的蜂巢

+1

可以使用xpath_string/xpath_int使用xpath_string解析 –

+0

感谢@ankur()我可以读出1级的数据,但如何读取嵌套数据? – avijit

回答

0
select xpath_string(line,'rec/name/fname'),xpath_string(line,'rec/name/lname'),xpath_int(line,'rec/age'), 
........................................... 
xpath_string(line,'rec/contact/phone/residence') from <table_name>; 

希望这将有助于..