db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Satheesh Bandaram <sathe...@Sourcery.Org>
Subject Re: XMLPARSE usage?
Date Tue, 14 Feb 2006 19:50:24 GMT
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Which version of JAVA are you using? Complete sysinfo output would be
useful. XML features of Derby currently has a dependency on Apache
Xerces parser and are enabled only from JDK 1.4 or higher. But I
thought Derby would provide a useful error message if this is not
found. I tried this, <b>without Xerces parser </b>being in the
CLASSPATH.<br>
<br>
ij&gt; connect 'tdb';<br>
ij&gt; create table xmltab (id integer, xml_col xml);<br>
ij&gt; 0 rows inserted/updated/deleted<br>
ij&gt; insert into xmltab values (1, xmlparse(document '&lt;simp&gt;
doc &lt;/simp&gt;'preserve whitespace));<br>
ERROR 2200L: XMLPARSE operand is not an XML document; see next
exception for details.<br>
ERROR XJ001: Java exception: 'SAX2 driver class
org.apache.xerces.parsers.SAXParser not found:
org.xml.sax.SAXException'.<br>
ij&gt; <br>
<br>
It worked in 10.2 as expected with the parser being in the classpath,
so something is missing... Are you using JDK 1.3 by any chance?<br>
<br>
There is an existing Improvement for 10.2 that may relax dependency on
Xerces parser, by using default parser provided by the JVM. But that
work is not complete yet.<br>
<br>
Satheesh<br>
<br>
Susan Cline wrote:<br>
<blockquote
 cite="mid20060214185757.84717.qmail@web81309.mail.mud.yahoo.com"
 type="cite">
  <pre wrap="">Hi,

I'm trying to use the XMLPARSE functionality that I believe is available in the 10.2 snapshot
jars;

truncated sysinfo output:

[C:\derby\db-derby-snapshot-10.2.0.0-372122\lib\derby.jar] 10.2.0.0 alpha - (372122)
[C:\derby\db-derby-snapshot-10.2.0.0-372122\lib\derbytools.jar] 10.2.0.0 alpha -
 (372122)

I found this post from May 2005 that had the correct usage at the time the initial patch was
posted:

<a class="moz-txt-link-freetext" href="http://mail-archives.apache.org/mod_mbox/db-derby-dev/200505.mbox/%3C4294CF0A.5060406@sbcglobal.net%3E">http://mail-archives.apache.org/mod_mbox/db-derby-dev/200505.mbox/%3C4294CF0A.5060406@sbcglobal.net%3E</a>

[ from the above post ]

Syntax is as follows:

XMLPARSE( DOCUMENT &lt;string-value-expression&gt; PRESERVE WHITESPACE )

Ex:

ij&gt; INSERT INTO xTable VALUES (1, XMLPARSE(DOCUMENT '&lt;simp&gt; doc &lt;/simp&gt;'

PRESERVE WHITESPACE));
1 row inserted/updated/deleted

[ end post ]

However, when I try the following I get errors:

ij&gt; create table xmltab (id integer, xml_col xml);

ij&gt; insert into xmltab values (1, xmlparse(document '&lt;simp&gt; doc &lt;/simp&gt;'preserve
whitespace));
ERROR XJ001: Java exception: ': java.lang.NullPointerException'.

ij&gt; insert into xmltab values (1, xmlparse(document '&lt;simp&gt; doc &lt;/simp&gt;'
preserve whitespace));
ERROR 40XT0: An internal error was identified by RawStore module.

Has the syntax for XMLPARSE changed?

If so, can someone post the correct syntax?  Similarly, if the syntax for XMLSERIALIZE and
XMLEXISTS has changed I'd like that information as well.

Thanks!

Susan 



  </pre>
</blockquote>
</body>
</html>


Mime
View raw message