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

Newbie question: dynamic output column ordering

Subject: Newbie question: dynamic output column ordering
From: "Mike Bandy" <michael.bandy@xxxxxxxxxxxxx>
Date: Wed, 23 Jan 2002 09:17:04 -0500
java output columns
I'm new to XSL, doing HTML report generation from an XML file.  I'm using
xalan with Java to drive my transformations and I'd like to be able to
specify the column ordering from my Java program.  So, from the XML below,
I'd like to pass in the order, left to right, of the columns in my HTML
report - for example "job_id,sow_id,date_created" or
"date_created,job_id,file_name" or whatever based on the user's entries into
a Java GUI.  (There's more to it than that, but this is where I'm stuck.)

How do I pass in the ordering and then break out the individual fields of
interest, then use the individual fields to extract the elements of
interest?  I can do it all hardcoded (like below), but how do I make it
dynamic based on parameters from my Java program?

This seems like a FAQ but I can't find an answer online - sorry if this is
trivial.

Thanks.

    Mike Bandy
    Entegrity Solutions
    Columbia Maryland

---- XSL snippet below ----
  <xsl:template match="record">
    <!--
          Output one row of the HTML table
     -->
    <tr>
      <td><strong><xsl:value-of select="job_id"/></strong></td>
      <td><xsl:value-of select="sow_id"/></td>
      <td><xsl:value-of select="date_completed"/></td>
    </tr>
  </xsl:template>

---- XML below ----
<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
<report>
  <record>
    <job_id>3Apserver_CORVETTE_01011209642894</job_id>
    <sow_id>B0AEAA2B2C55F6A41701010691436119</sow_id>
    <date_created>2002-01-16</date_created>
    <date_completed></date_completed>
    <status>Job Failed</status>
    <file_name>CORVETTE/3Apserver_CORVETTE_0</file_name>
    <file_size>10485760</file_size>
    <source_name>Corvette</source_name>
    <destination_name> </destination_name>
  </record>
  <record>
    <job_id>102Apserver_CORVETTE_01011233583133</job_id>
    <sow_id>B0AEAA2B2C55F6A41701010691436119</sow_id>
    <date_created>2002-01-16</date_created>
    <date_completed>2002-01-16</date_completed>
    <status>Job Completed</status>
    <file_name>CORVETTE/102Apserver_CORVETTE_0</file_name>
    <file_size>10485760</file_size>
    <source_name>Corvette</source_name>
    <destination_name> </destination_name>
  </record>
</report>




 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.