Jump to content
Changes to the Jaspersoft community edition download ×

Is styled text supported for XSL yet?


zethris

Recommended Posts

I read a post on here that it was not yet supported and that it will ignore the tags, but it was from 2 years ago. If it is supported now, I must be doing something wrong as it doesn't seem to want to work.

 

I have a report that needs to output into pdf as a bulleted list.

 

here is the XSL:

 

Code:

<xsl:«»stylesheet version="1.0" xmlns:«»xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="claim">
<li class="claim">
<a class="identifier"><xsl:value-of select="identifier"/></a>
<xsl:choose>
<xsl:when test="preamble != ''">
<xsl:value-of select="preamble" />
<xsl:apply-templates select="body/elements" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="content"/>
</xsl:otherwise>
</xsl:choose>
</li>
</xsl:template>

<xsl:template match="body/elements">
<ul>
<xsl:apply-templates select="element" />
</ul>
</xsl:template>

<xsl:template match="body/elements/element">
<li class="element" >
<xsl:value-of select="." />
</li>
</xsl:template>
</xsl:«»stylesheet>

 

this inserts the data that is being passed to it into the element, then passes that onto the .jasper report file. (attached)

 

THis is the scriptlet that I am trying to use:

 

Code:
[code]

package com.do.kun.report;

import net.sf.jasperreports.engine.JRDefaultScriptlet;
import net.sf.jasperreports.engine.JRScriptletException;

public class FSScriptlet extends JRDefaultScriptlet
{

String claimSchema = "/skin/claimschema.xml";
String claimTransform = "/skin/claimtransform_styled.xsl"; //this is the above xsl
//String claimSchema = "/skin/claimschema.xml";
//String claimTransform = "/skin/claimtransform_report.xml";

ContentParser cp = new ContentParser();

/**
*
*/
public String hello() throws JRScriptletException
{
return "Hello! I'm the report's scriptlet object.";
}

public String expandXML(String str){
return Utilities.expandXML(str);
}


public void beforeReportInit() throws JRScriptletException{
cp.setSchema(xSchema);
cp.setXSLTemplate(xTransform);
System.out.println("Doing this ... "«»);

}


public String formatClaimText(String claimText){

System.out.println("parsing claims ... " );

String claims = cp.parseDataStringToString(xText);
//return cp.parseDataStringToString(xText);

System.out.println("parsed " + claims );

return claims;
}

}

 

any ideas? need more information? Please let me know as this would be fantastic if I can get this to work.

 

I would think that since I am passing in those tags, it should just be working. Otherwise I misunderstand at which point the styled text tags would be processed and it is why it is just outputting the raw text.

 

[file name=Detail.jrxml size=38144]http://www.jasperforge.org/components/com_joomlaboard/uploaded/files/Detail.jrxml[/file]

Post edited by: zethris, at: 2007/05/25 13:59

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...