Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Loading XSL into XMLType Column
Hello,
I'm planning on storing XSL stylesheets that we use in our J2EE app in an Oracle 9.2.0.3.0 database. Originally we were planning on just storing them as CLOBs, but as we might need to manipulate the stylsheets on the fly and select only portions of them at a time, it would be great if we could store them as XMLTYPE.
I've created a table:
CREATE TABLE tst_pres_layout
(id NUMBER NOT NULL,
name VARCHAR2 (50) NOT NULL,
xsl XMLTYPE NOT NULL)
/
and now I'm trying to insert an XSL stylesheet into the XMLTYPE column:
DECLARE
lXsl CLOB :=
'<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet [
<!ENTITY nbsp " ">
]>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"/>
<xsl:include href="JavaScript - HTML - Standard.xslt"/>
<xsl:include href="Header - HTML - Standard.xslt"/>
<xsl:include href="Grid - HTML - Standard.xslt"/>
<xsl:include href="Footer - HTML - Standard.xslt"/>
<!--TEMPLATE - doReport-->
<xsl:template match="/report" name="doReport">
<html> <head> <title> DRAFT - <xsl:value-of select="metadata/title"/> </title> <link> <xsl:attribute
<xsl:attribute name="rel">stylesheet</xsl:attribute> <xsl:attribute name="type">text/css</xsl:attribute> </link> <xsl:call-template name="doJavaScriptFunctions"/> </head> <body> <xsl:call-template name="doHeader"/> <xsl:call-template name="doGrid"/> <xsl:call-template name="doFooter"/> </body> </html>
</xsl:template>
I'm receiving the following error:
11:08:52 AM ORA-31011: XML parsing failed 11:08:52 AM ORA-19202: Error occurred in XML processing 11:08:52 AM LPX-00104: Warning: element "xsl:stylesheet" is not declared inthe DTD
11:08:52 AM Error at line 5 11:08:52 AM ORA-06512: at "SYS.XMLTYPE", line 0 11:08:52 AM ORA-06512: at line 1 11:08:52 AM ORA-06512: at line 38
Am I missing a step I need to take in order to insert this XML into the table? Do I need to register a DTD or something with the column? If so, can I get an example of how to do that? I've seen plenty of examples of registering schemas, but not DTDs. I would think that since this is a W3C compliant document it would be inserted with no problem.
Thanks!
Leo Hart
Received on Mon May 24 2004 - 07:36:12 CDT