Saving all output to "!!{outputDirectory}!!/udf_xpath_string.q.raw". Enter "record" with no arguments to stop it.
>>> !run !!{qFileDirectory}!!/udf_xpath_string.q
>>> DESCRIBE FUNCTION xpath_string ;
'tab_name'
'xpath_string(xml, xpath) - Returns the text contents of the first xml node that matches the xpath expression'
1 row selected
>>> DESCRIBE FUNCTION EXTENDED xpath_string ;
'tab_name'
'xpath_string(xml, xpath) - Returns the text contents of the first xml node that matches the xpath expression'
'Example:'
' > SELECT xpath_string('bcc','a/c') FROM src LIMIT 1;'
' 'cc''
' > SELECT xpath_string('b1b2','a/b') FROM src LIMIT 1;'
' 'b1''
' > SELECT xpath_string('b1b2','a/b[2]') FROM src LIMIT 1;'
' 'b2''
' > SELECT xpath_string('b1b2','a') FROM src LIMIT 1;'
' 'b1b2''
10 rows selected
>>>
>>> SELECT xpath_string ('bbcc', 'a') FROM src LIMIT 1 ;
'_c0'
'bbcc'
1 row selected
>>> SELECT xpath_string ('bbcc', 'a/b') FROM src LIMIT 1 ;
'_c0'
'bb'
1 row selected
>>> SELECT xpath_string ('bbcc', 'a/c') FROM src LIMIT 1 ;
'_c0'
'cc'
1 row selected
>>> SELECT xpath_string ('bbcc', 'a/d') FROM src LIMIT 1 ;
'_c0'
''
1 row selected
>>> SELECT xpath_string ('b1b2', '//b') FROM src LIMIT 1 ;
'_c0'
'b1'
1 row selected
>>> SELECT xpath_string ('b1b2', 'a/b[1]') FROM src LIMIT 1 ;
'_c0'
'b1'
1 row selected
>>> SELECT xpath_string ('b1b2', 'a/b[2]') FROM src LIMIT 1 ;
'_c0'
'b2'
1 row selected
>>> SELECT xpath_string ('b1b2', 'a/b[@id="b_2"]') FROM src LIMIT 1 ;
'_c0'
'b2'
1 row selected
>>> !record