DataMapper - JSON -> XML - Add a colon in XML tag [message #674457] |
Mon, 28 January 2019 02:54 |
|
tutu10
Messages: 2 Registered: January 2019
|
Junior Member |
|
|
Hello everyone,
Today i want to generate an XML file from a JSON.
I already generate XML files but I here I want to generate a particular one, this is an XML in google format.
Like this:
<entry>
<g:id>114778689</g:id>
<g:title>My PRODUCT</g:title>
</entry>
My problem is the colon because on STUDIO it is prohibit to add a colon( : ) in an XML tag.
Has anyone had a solution to work this in mapping?
Actual, the only solution is to make a replacement after file generation (not good).
Thank's for your help !
|
|
|
Re: DataMapper - JSON -> XML - Add a colon in XML tag [message #674459 is a reply to message #674457] |
Mon, 28 January 2019 03:27 |
_jum
Messages: 577 Registered: February 2008
|
Senior Member |
|
|
You could use namespace notation:
WITH data ( id, title) AS
(SELECT 114778689, 'My PRODUCT' FROM dual)
SELECT xmlelement
("entry"
,xmlelement("g:id", id)
,xmlelement("g:title", title)
) xd
FROM data;
XD
----------------------------------------------------------------------
<entry><g:id>114778689</g:id><g:title>My PRODUCT</g:title></entry>
[Updated on: Mon, 28 January 2019 03:28] Report message to a moderator
|
|
|