Storing SQL text as an XML element

Tuesday, 10 October 2017 · 3 messages
DD
Dave Day10 Oct 2017 01:27 #
Greeting list, Is there anything 'special' that needs to be done to an SQL statement to save it as an XML element in BaseX? Create the element, move the text? What happens if the SQL has the "<" or ">" embedded within the text? Regards, -- Dave Day
ML
Marco Lettere10 Oct 2017 09:33 #
Hi Dave, what we usually do, to stay on the safe side, is to store code in CDATA sections. For example:
<code><![CDATA[
      if(1 < 2) then return true;
]]></code>
Even if, for smaller sections of code maybe escaping XML character such as <, >, & should be sufficient. Regards, Marco.
Quoted text · Dave Day · 13 lines
On 09/10/2017 23:28, Dave Day wrote: > Greeting list, > > Is there anything 'special' that needs to be done to an SQL > statement to save it as an XML element in BaseX? > > Create the element, move the text? What happens if the SQL has > the "<" or ">" embedded within the text? > > Regards, > > -- Dave Day >
DD
Dave Day10 Oct 2017 15:21 #
Marco, Thanks. -- Dave
Quoted text · Marco Lettere · 32 lines
On 10/10/2017 2:33 AM, Marco Lettere wrote: > Hi Dave, > what we usually do, to stay on the safe side, is to store code in > CDATA sections. > > For example: > > <code><![CDATA[ > if(1 < 2) then return true; > ]]></code> > > Even if, for smaller sections of code maybe escaping XML character > such as <, >, & should be sufficient. > > Regards, > Marco. > > On 09/10/2017 23:28, Dave Day wrote: >> Greeting list, >> >> Is there anything 'special' that needs to be done to an SQL >> statement to save it as an XML element in BaseX? >> >> Create the element, move the text? What happens if the SQL has >> the "<" or ">" embedded within the text? >> >> Regards, >> >> -- Dave Day >> > >

⚡Generated with XQuery