Skip to Main Content

How to create XML with <![CDATA[<?xml

User_RFKSXMay 28 2020 — edited Jun 4 2020

Hi,

I have to generate an XML object and I'll use :

select xmlelement("TAG1",

          xmlelement("TAG2",col2),

          xmlelement("TAG3",

          xmlelement("TAG4",col4))).extract('/*')

from MYTABLE ...

I have also to create the line <![CDATA[<?xml version="1.0" encoding="UTF-8" standalone="yes"?> .

How can I do it? I've read there's the XMLCdata function but how can I use it?

The XML is something like this:

<TAG1>

<TAG2> 5 </TAG2>

![CDATA[<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<TAG3>

<TAG4> jack </TAG4>

</TAG3  ]]>

</TAG1>

Other question: if I load an XML like that into a XMLTYPE column, is it possible to extract tag values by using extractValue even for the tags inside/after the ![CDATA[ section ?

Thank you!

Mark

This post has been answered by odie_63 on Jun 1 2020
Jump to Answer
Comments
Post Details
Added on May 28 2020
7 comments
1,740 views