Question

I have an XSQL file where i fetch data from a database and then display in the form of a table. I have to append a dropdown menu and two buttons to each record of the table. I append these by embedding HTML code into the XSQL file using CDATA.

However, the browser fails to interpret the code within CDATA automatically. The HTML code gets displayed in the table instead of the dropdowns and buttons. If i explicitly manipulate some HTML tag element using some browser code viewer plugin, the browser re-interprets the data and then displays the appropriate dropdown or button.

This is my code:

<xsql:query rowset-element="TABLE" max-rows="2000" null-indicator="y">
select 
a.name,
a.age,

<![CDATA[ 
    ('<select>
        <option value="0">Select Salary</option>
        <option value ="Value1">Value1</option>
        <option value ="Value2">Value2</option>
        <option value ="Value3">Value3</option>
     </select>
    ')
]]>  as One,


<![CDATA[ 
  ('<input type="submit" class="insertresponse" id="insert" value="Insert">')
]]>  as Two,

<![CDATA[ 
  ('<input type="submit" class="deleteresponse" id="delete" value="Delete">')
]]>  as Three

from TABLE_ABC a
where (a.age > 20)
</xsql:query>

This is some sample output that i get:

Kindly help me in this regard.

Was it helpful?

Solution

Resolved this issue by adding disable-output-escaping="yes" to the xsl file.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top