Insertion Issues with PL / SQL Developer

I have the following script that I want to insert into a table, but I have some problems with it.

declare v_xslt9 varchar2(32767) := '<?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="html" encoding="UTF-8" indent="yes"/> <xsl:template name="Template"> <xsl:text>Kære </xsl:text> <xsl:value-of select="/nameValueMap/entry[string=''FIRST_NAME'']/string[2]"/> <xsl:text>&nbsp;</xsl:text> <xsl:value-of select="/nameValueMap/entry[string=''LAST_NAME'']/string[2]"/></xsl:template> </xsl:stylesheet>' begin insert into XSLT values ('','Note',sysdate,v_xslt9,sysdate,'T','') end; 

The part of interest consists of the following

 <xsl:text>&nbsp;</xsl:text> 

I am using PL / SQL Developer and when I run the script above it will recognize

 &nbsp; 

as an object, and then I need to enter the value that I want in it. I want a simple space inside XSL, so the first and last name will be separated. I tried all the suggestions at the following link: orafaq - I just can't get it to work. Either it fails when I try to insert, or it fails when I retrieve data.

Is there an easy way to insert a space in XSL?

+4
source share
4 answers

Use the command window instead of the SQL window to run scripts in PL / SQL Developer. To convert one window view to another type, simply right-click anywhere in the window and select "Change Window To" => "Command Window".

Then run the script as in SQL * Plus - in this case with SET DEFINE OFF as the first line.

+6
source

use

 '<xsl:text>'||'&'||'nbsp;</xsl:text>' 

he will solve the problem everywhere and forever, and also for you - for each future user.

Just highlight the character

+4
source
 <xsl:text>&&nbsp;</xsl:text> 

In the PL / SQL Developer's Guide:

If you want to use ampersand in SQL text that should not be interpreted as a substitution variable, use double ampersand instead.

+2
source

Try:

 '<xsl:text>'||unistr('\00A0')||'</xsl:text>' 

This unistr('\00A0') function returns Unicode NO-BREAK SPACE

Or, if you want the object itself, you can try the following:

 '<xsl:text>'||chr(38)||'nbsp;</xsl:text>' 

chr(38) returns the letter ampersand without prompting for input.

+2
source

Source: https://habr.com/ru/post/1390055/


All Articles