[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Detail tables handled in XSLT, XSQL, ORACLE

Subject: Detail tables handled in XSLT, XSQL, ORACLE
From: "Rob Jagelski" <rjagelski@xxxxxxxxxxx>
Date: Mon, 30 Oct 2000 14:38:05 -0400 (EST)
xsql oracle
Hello,

I'm new to XSL and have a question. How are detail records handled in XSL? I've found an example that works, but instead of inserting records into a database, it displays them as HTML. I thought that I could tweek the XSL file to write to my database instead, but I've been unsuccessful so far. I'm using an Oracle database and its XSQL java servlet. The example I'm trying to get to work is one that's shipped with Oracle's servlet. It's an employee/department demo with one master department record having many employee records. I ran the scripts Oracle sent and can successfully insert a record into my database from SQL Plus and TOAD. The problem occurs when I try to insert a record using XML and XSL. Following is the SQL statement that successfully inserted a record:

*****
insert into department values (5, 'Engineering', 'Portland', emp_list(emp_t(10, 'Bret', 25),emp_t(11, 'Steve', 27)));
*****


department is a view table and emp_list is a type of Employee table containing one or more emp_t records. emp_t is a type of Employee table record.

Following is the XSL document:

*****
<?xml version = '1.0'?>
<ROWSET xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xsl:version="1.0">

<xsl:for-each select="ROWSET/ROW">

 <ROW>
   <DEPTNO><xsl:value-of select="DEPTNO"/></DEPTNO>
   <DNAME><xsl:value-of select="DNAME"/></DNAME>
   <LOC><xsl:value-of select="LOC"/></LOC>
   <xsl:for-each select="EMPLOYEES/EMPLOYEES_ITEM">
     <EMPLOYEES>emp_list(emp_t(<xsl:value-of select="EMPNO"/>
     <xsl:value-of select="ENAME"/>
     <xsl:value-of select="SAL"/>))</EMPLOYEES>
   </xsl:for-each>
 </ROW>

</xsl:for-each>

</ROWSET>
*****

Following is the XML file:

<ROWSET>
 <ROW>
   <DEPTNO>99</DEPTNO>
   <DNAME>ACCOUNTING</DNAME>
   <LOC>NEW YORK</LOC>
   <EMPLOYEES>
      <EMPLOYEES_ITEM>
         <EMPNO>1111</EMPNO>
         <ENAME>CLARK</ENAME>
         <SAL>2450</SAL>
      </EMPLOYEES_ITEM>
      <EMPLOYEES_ITEM>
         <EMPNO>2222</EMPNO>
         <ENAME>KING</ENAME>
         <SAL>5000</SAL>
      </EMPLOYEES_ITEM>
      <EMPLOYEES_ITEM>
         <EMPNO>3333</EMPNO>
         <ENAME>MILLER</ENAME>
         <SAL>1300</SAL>
      </EMPLOYEES_ITEM>
   </EMPLOYEES>
 </ROW>
</ROWSET>
*****

Following is the XSQL file:

<?xml version='1.0'?>
<xsql:insert-request connection="rob" xmlns:xsql="urn:oracle-xsql"
 table="department" transform="address_insert2.xsl"/>
*****

Any help is very much appreciated since documentation is so limited.

Thanks so much,
Rob


_________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at http://profiles.msn.com.




XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.