DairylandDan
Programmer
Hey hey! I'm back, and asking for more assistance! <groan>
OK, I'm on AIX trying to extract data from an xml document and insert it into an Oracle 10g sid.
But, rather than look at my real data, let's look at the classic books xml example.
Here's the xml:
Here's the db:
Here's the xsl:
and here's the xsql:
from the command line, when I try to invoke the xsql utility as follows:
I get the following error:
Can anyone explain to me what I've done wrong? Thanx in advance!
DLD
OK, I'm on AIX trying to extract data from an xml document and insert it into an Oracle 10g sid.
But, rather than look at my real data, let's look at the classic books xml example.
Here's the xml:
Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<book ID="BN002" version="final">
<author ID="A0001">kvattem</author>
<title>Oracle XDK</title>
<price>50</price>
</book>
Here's the db:
Code:
CREATE TABLE BOOK (
ID VARCHAR2(80),
VERSION VARCHAR2(80),
AUTHORID VARCHAR2(80),
TITLE VARCHAR2(80),
PRICE NUMBER
);
Here's the xsl:
Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="[URL unfurl="true"]http://www.w3.org/1999/XSL/Transform">[/URL]
<!-- insert-book.xsl -->
<ROWSET xmlns:xsl="[URL unfurl="true"]http://www.w3.org/1999/XSL/Transform"[/URL] xsl:version="1.0">
<xsl:for-each select="//book">
<ROW>
<ID><xsl:value-of select="@ID"/></ID>
<VERSION><xsl:value-of select="@version"/></VERSION>
<!-- We're ignoring the author, just getting the author's id -->
<AUTHORID><xsl:value-of select="author/@id"/></AUTHORID>
<TITLE><xsl:value-of select="title" /></TITLE>
<PRICE><xsl:value-of select="price"/></PRICE>
</ROW>
</xsl:for-each>
</ROWSET>
and here's the xsql:
Code:
<?xml version="1.0"?>
<!-- insert-book.xsql -->
<xsql:insert-request xmlns:xsql="urn:oracle-xsql" table="BOOK" transform="insert-book.xsl" connection="testapps"/>
from the command line, when I try to invoke the xsql utility as follows:
Code:
xsql insert-book.xsql posted-xml=book.xml
xsql-status action="xsql:insert-request" rows="1"
I get the following error:
Code:
<?xml version = '1.0'?>
<!-- insert-book.xsql -->
<xsql-error action="xsql:insert-request">
<message>Unexpected EOF.</message>
</xsql-error>
Can anyone explain to me what I've done wrong? Thanx in advance!
DLD