[xsl] Database Actions Request within XML

Subject: [xsl] Database Actions Request within XML
From: "yvesazie@xxxxxxxxxxxxx" <yvesazie@xxxxxxxxxxxxx>
Date: Thu, 31 Jan 2002 08:03:06 -0500
Hi there.

I need your opinion for the best approach to take to resolve the following XSLT programing problem.

  I am writing a set of database APIs (vendor is Oracle) that accept as input an XML document, and output the same XML document with additional information queried from the database.  The input document contains database elements name <database>.  within each database element, several sub-elements exist their values are used to query the database for the rest of the information, using the keys provided within the input XML document.

  Here is a sample of an input document: for what I call a "get" action.

  <?xml version="1.0" encoding="UTF-8"?>
  <vnml xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:noNamespaceSchemaLocation="D:\VNML.xsd">
          <project>
                  <database>
                          <action>
                                  <get>
                                          <id>112</id>
                                  </get>
                          </action>
                  </database>
                  <portfolio>
                          <database>
                                  <action>
                                          <get>
                                                  <id>321</id>
                                          </get>
                                  </action>
                          </database>
                  </portfolio>
          </project>
  </vnml>

  After the database processes this file the output should look like this

  <?xml version="1.0" encoding="UTF-8"?>
  <vnml xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:noNamespaceSchemaLocation="D:\abc..xsd">
          <project>
                  <database id="112">
                          <feedback>
                                  <status>success</status>
                                  <message>Project successfully retrieved</message>
                          </feedback>
                  </database>
                  <portfolio>
                          <database id="321">
                                  <feedback>
                                          <status>success</status>
                                          <message>Portfolio successfully retrieved</message>
                                  </feedback>
                          </database>
                          <instrument>
                                  <database id="231" name="31359UHW8" type="CMO" asof_date="2001-12-31T00:00:00"/>
                                  <cmo>
                                          <cusip>Text</cusip>
                                          <ownedUpb>100</ownedUpb>
                                          <prepaymentMultiplier>Text</prepaymentMultiplier>
                                          <allowLifeFloorLargerThanWAC>Text</allowLifeFloorLargerThanWAC>
                                  </cmo>
                          </instrument>
                  </portfolio>
          </project>
  </vnml>

  Our goal is basically this:  to send incomplete documents to the database and expect the database to complete the missing pieces.  Note that there are 
  several action the database needs to be able to do with each such document:  get (retrieve database info based on on supplied key and embed that in the 
  same document), put (save information in database and return database keys back to the document), resolve (attempt the get database info when only 
  some of the keys are available, the output being embedded in the same document).

Note that the XML fragments required for a <get> action has a different structure depending on which element requested a <get>.  This XML fragment is data from several relational tables.  A document may also contain other interspersed XML fragments with no database sections that still need to part of the output unchanged both in position and content.

  From a software design veiw how would you solve this type of database resolution/embedding requirement?

  I'd appreciate any thoughts on ways of accomplishing this.

  Cheers,

  Yves.

--------------------------------------------------------------------
mail2web - Check your email from the web at
http://mail2web.com/ .


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


Current Thread