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

Transforming data through Xalan

Subject: Transforming data through Xalan
From: "Pavitra Jain" <pavitra.jain@xxxxxxxxx>
Date: Thu, 14 Mar 2002 16:59:24 +0530
xml xal in jsp
Hi All,

Thank you for providing a forum like this for newbies like me.

My problem is that:

I have a JSP page which displays the various columns and look and feel based
on the selections made by user during account setup. This "metadata" is
stored in an XML file.

While displaying the page I want to read the metadata, read a Java
collection (Vector) holding the records and convert it into SAX events on
the fly and apply one standard XSL to it. SAX events are generated for only
those data columns whose equivalent metadata have text value "Y". All this
transformation needs to be done at server-side only.

The solution that I have been working with is

1- take input from user in a JSP page process the request and write the XML
file.

2- To generate the output XML, I parse this xml file into a dom tree and get
the Java Bean holding the Vector of Java objects to been displayed. I
generate the elements through my own parser extending XMLReader interface
(only those elements that need to be shown)

3- the XML generated by the TransformerHandlerIdentity contenthandler is
correct but when I plug the stylesheet into TransformerHandler the XSL
transformation do not get applied.

I have traced the transformation through the xalan debugging classes and the
output says

"file:///c:/ims/xsl/scheme.xsl Line #5, Column #25: template match='/'
STARTDOCUMENT
file:///c:/ims/xsl/scheme.xsl Line #6, Column #21: table
file:///c:/ims/xsl/scheme.xsl Line #7, Column #40: for-each
file:///c:/ims/xsl/scheme.xsl Line #7, Column #40: for-each, select='null':
     [empty node list]
STARTELEMENT: table
ENDELEMENT: table
ENDDOCUMENT


for the xsl file which reads like

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="html"/>

<xsl:template match="/">
  <table border="1">
   <xsl:for-each select="issues/issue">
     <tr>
     <xsl:apply-templates/>
     </tr>
    </xsl:for-each>
  </table>
</xsl:template>
 <xsl:template match="column">
 <td>
     <xsl:value-of select="@name"/>
 </td>
 </xsl:template>
</xsl:stylesheet>

I would be glad to provide any information needed.

TIA,
Regards,
Pavitra Jain


 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.