Adding the preserve option to every tag keeps the spaces in the tags. But XMLTable still returns null for me:
CREATE TABLE test(
item_data XMLTYPE,
id NUMBER
)XMLTYPE COLUMN item_data STORE AS SECUREFILE BINARY XML;
INSERT INTO test(
item_data,
id
)VALUES(
'<ROWSET xml:space="preserve"> <ROW> <T1> </T1> </ROW> </ROWSET> ',
4
);
INSERT INTO test(
item_data,
id
)VALUES(
'<ROWSET xml:space="preserve"><ROW><T1 xml:space="preserve"> </T1> </ROW> </ROWSET> ',
5
);
set long 1000
SELECT
ucd."T1" AS "T1",
id,
ucd.item_data
FROM
test x,
XMLTABLE('/ROWSET/ROW' PASSING x.item_data COLUMNS item_data XMLTYPE PATH '*',"T1" VARCHAR2(4000)PATH 'T1')ucd;
T1 ID ITEM_DATA
<null> 4 <T1></T1>
<null> 5 <T1 xml:space="preserve"> </T1>
I think you're going to have to take this one up with support.