General discussion

Locked

xmlns+JScript+XSLT-Doubt, please claify

By angeshwar ·
Hi all,

I have a coding here.
XSL FILE:

<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt"
xmlns:user="http://">

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

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

]]>
</msxsl:script>

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

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

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

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

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

</table>

</xsl:for-each>
</body></html>
</xsl:template>
</xsl:stylesheet>

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.

bye,
with regards,
Deepak.

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"?>
<BugCollection>

<Project filename="<<unnamed project>>">
<Jar>\deepak\buildProcess_2\logging\build\class</Jar>
<SrcDir>\deepak\buildProcess_2\logging\build\src</SrcDir>

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

<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"/>
</BugInstance>

</BugCollection>

This conversation is currently closed to new comments.

0 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Back to Web Development Forum
0 total posts (Page 1 of 1)  

Related Discussions

Related Forums