I have the following script that I want to insert into a table, but I’m having some issues 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> </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 is the following
<xsl:text> </xsl:text>
I’m using PL/SQL Developer and when I run the script above it recognises
as an entity and I then have to type in what value I want in it. What I want is a simple whitespace within the XSL such that the first and last name will be separated. I’ve tried all suggestions from the following link: orafaq – I just cant get it to work. Either it fails when I try to insert or it fails when I extract the data.
Is there some easy way of inserting a whitespace in the XSL?
Use a command window instead of a SQL window to run scripts in PL/SQL Developer. To transform one kind of window into another type, just right-click anywhere in the window and select “Change Window to” => “Command Window”.
Then run your script as in SQL*Plus — in this case with
SET DEFINE OFFas the first line.