Web Development

General discussion


xmlns+JScript+XSLT-Doubt, please claify

By angeshwar ·
Hi all,

I have a coding here.

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

<msxsl:script language="JScript" implements-prefix="user">

function myfunction(getvalue)
var strn = getvalue;
return strn;


<xsl:template match="/">
<title>Findbugs Summary Report</title>

<h2 align="center">Findbugs Summary Report</h2>

<xsl:for-each select = "BugCollection/BugInstance">

<table border="1" cellpadding="1" cellspacing="0" width="65" height="25">

<xsl:variable name="var1" select="Class/@classname" />
<h2>Package Name:<xsl:value-of select="user:myfunction($var1)"/></h2>

<tr> <td> Type: </td> <td> <xsl:value-of select="@type"/> </td> </tr>
<tr> <td> Priority: </td> <td> <xsl:value-of select="@priority"/> </td> </tr>
<tr> <td> Source File: </td> <td> <xsl:value-of select="SourceLine/@sourcefile"/> </td> </tr>
<tr> <td> Class Name: </td> <td> <xsl:value-of select="Class/@classname" /> <xsl:value-of select="Class" /> </td> </tr>
<tr> <td> Method Name: </td> <td> <xsl:value-of select="Method/@name"/> </td> </tr>
<tr> <td> Start: </td> <td> <xsl:value-of select="Method/SourceLine/@start"/> </td> </tr>
<tr> <td> End: </td> <td> <xsl:value-of select="Method/SourceLine/@end"/> </td> </tr>



My aim is to pass the value of $var1 to the function-my function and manipulate that value in a script code. The value passed to the function is something like a.b.c.d.e and i have to change it as a.b.c.d (ie remove the last word after last . to get the package name of a java class name).

My doubt is-what is the datatype of the value passed to the function. if its string how to manipulate it and by using what function(any built it). I doubt if its a string, if its not then how to change it to a string and make changes to it.

with regards,

Here is a small part of the xml file

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="bcel-fb1.xsl"?>

<Project filename="<<unnamed project>>">


<BugInstance type="URF_UNREAD_FIELD" priority="2">
<Class> dcx.sysman.logging.SMIEntityBeanLogger</Class>
<Field classname="dcx.sysman.logging.SMIEntityBeanLogger" name="privateLogHandler" signature="Ldcx/sysman/logging/handler/SMILogHandler;" isStatic="false"/>

<BugInstance type="MS_PKGPROTECT" priority="2">
<Class classname="dcx.sysman.logging.SMILogManager"/>
<Field classname="dcx.sysman.logging.SMILogManager" name="globalLogHandler" signature="Ldcx.sysman.logging.handler.SMIGlobalLogHandler;" isStatic="true"/>


This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Comments

Related Discussions

Related Forums