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

XSLT Question

Subject: XSLT Question
From: Chris Knoll <knoll@xxxxxxxxxxx>
Date: Sat, 26 Feb 2000 01:02:11 -0500
chris knoll
I have written an application that performs
 querries, but to allow maximum flexability, I
 defined the following interfaces:

 public interface QueryEngine
 {
   QueryResults doQuery(SearchParameters sp);
 }

 public interface QueryResults()
 {
   String getString(String fieldname);
   void next();
   boolean hasMoreElements();
 }

 The only assumption made in this archetecture is
 that the results returned by the QueryEngine is in
 a tabluar form.  However, we have made the move to
 performing querries using a Message Queue and the
 format of the queries is in XML, and the resutls
 are XML too.  here's the problem: Consider the
 following query results gained by a traditional
 SQL query:

 OrderID  ModelId  ModelDesc  Qty  Price Status
 Order1    ModelA    DvD        1    1.00  Done
 Order1    ModelB    Monitor    1    3.00  Wait
 Order2    ModelA    DvD        2    2.00  Wait
 Order2    ModelD    CPU        1    5.00  Done

 This query results indicates that there is 2
 orders, with 2 line items each.  Now, consider the
 following query results as an XML document that we
 will be getting from our new system:

 <order id="Order1">
     <line>
         <model id='ModelA'>DvD</model>
         <quantity>1</quantity>
         <price>5</price>
         <status>Done</status>
     </line>
     <line>
         <model id='ModelD'>Monitor</model>
         <quantity>2</quantity>
         <price>7</price>
         <status>Wait</status>
     </line>
 </order>
 <order id="Order2">
     <line>
         <model id='ModelA'>DvD</model>
         <quantity>1</quantity>
         <price>5</price>
         <status>Done</status>
     </line>
     <line>
         <model id='Modeld'>CPU</model>
         <quantity>2</quantity>
         <price>7</price>
         <status>Wait</status>
     </line>
 </order>

 The question is: how can i transform this XML
 document into tabluar form.  better yet, is there
 a generic transformation that i can apply to any
 XML document that will flatten it into a table?

 Any help would be greatly appreciated.  You can
 contact me with answers at knoll@xxxxxxxxxxx

 -Chris



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


Current Thread
  • XSLT Question
    • Chris Knoll - Sat, 26 Feb 2000 01:02:11 -0500 <=

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.