Brug DETEXML og se efter XPath //*[not(text())][not(*)] for at finde elementer, der ikke indeholder nogen tekst og ingen underordnede:
Oracle 11g R2 Schema Setup :
OPRET TABEL tabelnavn ( xml ) ASSELECT XMLTYPE( ' 9999 S Testplacering 08 ' ) FRA DOBBELT; Forespørgsel 1 :
SELECT DELETEXML( xml, '//*[not(text())][not(*)]' ).getStringVal()FROM tabelnavn | DELETEXML(XML,'//*[NOT(TEXT())][NOT(*)]').GETSTRINGVAL() ||--------------------------- -------------------------------------------------- -------------------------------------------------- ----------------------------|| 9999 S Testplacering 08 |