This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Transforming data through Xalan


Hi,

Thanks for replying. Pasting the output of identity transformation on The
SAX events
But I think the problem lies else where in the design as I am able to
generate the desired html on the command line from this xml and the xsl I
pasted in the last mail. Also I have applied you suggestion too. Actually I
have written many variation of both declarative and procedural styles and
all seem to work on the static output but not when these exist as events.

<issues>
<issue>
<column name="issue-id">Issue1</column>
<column name="module-name">IMS1</column>
<column name="issue-description">JavaScript Error</column>
</issue>
<issue>
<column name="issue-id">Issue2</column>
<column name="module-name">IMS2</column>
<column name="issue-description">JavaScript Error</column>
</issue>
<issue>
<column name="issue-id">Issue3</column>
<column name="module-name">IMS3</column>
<column name="issue-description">Java Error</column>
</issue>
<issue>
<column name="issue-id">Issue4</column>
<column name="module-name">IMS4</column>
<column name="issue-description">Java Error</column>
</issue>
<issue>
<column name="issue-id">Issue5</column>
<column name="module-name">IMS5</column>
<column name="issue-description">Classpath Error</column>
</issue>
</issues>

Regards,
Pavitra Jain

-----Original Message-----
From: owner-xsl-list@lists.mulberrytech.com
[mailto:owner-xsl-list@lists.mulberrytech.com]On Behalf Of Andrew Welch
Sent: Friday, March 15, 2002 5:56 PM
To: xsl-list@lists.mulberrytech.com
Subject: Re: [xsl] Transforming data through Xalan


Hi,

Without seeing your source xml I can't say for sure... but it looks as
though your <xsl:for-each> can't find 'issues/issue' as a child of the root.
You could use

<xsl:for-each select="//issues/issue">

which will find all 'issue' elements with parent 'issues' throughout the
whole xml doc, or you could make the path more specific (you will need to
post some of your xml for help with that one)

cheers
andrew


>
> 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
>
>


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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]