Is there any way to know whether the self-closing(<privacy />
) XML tag exist inside the xml, using the mysql
ExtractValue
xpath function.
The xml is,
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<employees>
<employee>
<privacy />
<firstName>Brian</firstName>
<lastName>Schultz</lastName>
</employee>
</employees>
SP is
CREATE DEFINER=`root`@`%` PROCEDURE `xpath1`(IN xml VARCHAR(10000))
BEGIN
SELECT ExtractValue(xml, '//employee/firstName/text()');
/*SELECT ExtractValue(xml, '//employee/privacy');
SELECT ExtractValue(xml, '//employee/privacy/text()');*/
END
ExtractValue(xml, '//employee/privacy');
& ExtractValue(xml, '//employee/privacy/text()');
always return empty space in the result with or without the self-closing tag.
The xml is coming from external app. Any help is great..