473,394 Members | 1,932 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

xsl code question

Hi,

I am trying to produce the following in javacode;

public void action<An actionName>(String value1, int value
2....,Coordinator c) throws Exception;

The arguments to the actionXXX could be from only a Coordiantor and up
to any number of int:s and Strings before ( however not to many in
practice).

My problem is when I have found the parameter element (that is, extra
parameters besides the Coordinator) is it possible "produce" the extra
parameters within the (......................) ? Is it a good idea to
have it in a separate template? When I run my transformation it seems
like I never get to the parameter template. Any ideas why?

All help and time spent on this matter is greatly appreciated.

//Mikael

an action in xml file could look like this:
===========================================
<action name="startPn">
<description>PN generation is started on Pch and pnlsActive
is set TRUE.Ref. [FS_UPT]</description>
<returnType>
<void/>
</returnType>
<parameter name="pnTfi">
<in/>
<dataType>
<long/>
</dataType>
</parameter>
<raisesException name="InternalErrorException"/>
<raisesException name="MoDisabledException"/>
<raisesException name="AlreadyActiveException"/>
</action>
xsl template for action looks like this ( from row 7)
================================================== ===

<xsl:template match="action" mode="action">
<xsl:for-each select=".">
<xsl:choose>
<xsl:when test="returnType/void">
public void action<xsl:call-template name="CapFirstLetterOfAttr">
<xsl:with-param name="x"
select="@name"/></xsl:call-template><xsl:if test="parameter">
<xsl:for-each select="parameter">
<xsl:apply-templates select="parameter"/>
</xsl:for-each>
</xsl:if>
(Coordinator c) throws MoAccessException<xsl:if
test="raisesException">
<xsl:text>,</xsl:text></xsl:if><xsl:text>
</xsl:text><xsl:for-each select="raisesException"><xsl:value-of
select="@name"/>
<xsl:if test="not(position()=last())">,<xsl:text>
</xsl:text> </xsl:if></xsl:for-each>;
</xsl:when>
<xsl:when test="returnType/structRef">
public Struct action<xsl:call-template name="CapFirstLetterOfAttr">
<xsl:with-param name="x"
select="@name"/></xsl:call-template>(Coordinator c) throws
MoAccessException<xsl:if test="raisesException">
<xsl:text>,</xsl:text></xsl:if><xsl:text>
</xsl:text><xsl:for-each select="raisesException"><xsl:value-of
select="@name"/>
<xsl:if test="not(position()=last())">,<xsl:text>
</xsl:text> </xsl:if></xsl:for-each>;
</xsl:when>
</xsl:choose>
</xsl:for-each>
</xsl:template>

The template xsl
================

<xsl:template match="parameter">
<xsl:value-of select="@name"/>
<xsl:choose>
<xsl:when test="in/dataType/string">
Sting <xsl:value-of select="@name"/>,
</xsl:when>
<xsl:when test="in/dataType/long">
int <xsl:value-of select="@name"/>,
</xsl:when>
</xsl:choose>
</xsl:template>

Jul 20 '05 #1
0 1597

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Mohammed Mazid | last post by:
Hi folks! Can anyone please help me with this? I am developing a Quiz program but I am stuck with "multiple answers". Basically I need some sort of code that would select multiple answers...
70
by: grün | last post by:
The MSDN techdocs are somewhat limited on this and I wanted more information. Is there any resource that says definitively which is faster /O2 or /Ox and by how much?
19
by: Rhek | last post by:
Hello, I would like to apologize for double posting this question because I posted this same question in what looks like the VB 6 newgroups and not the .Net newsgroup... Here goes: The code...
67
by: Steven T. Hatton | last post by:
Some people have suggested the desire for code completion and refined edit-time error detection are an indication of incompetence on the part of the programmer who wants such features. ...
34
by: Mark Kamoski | last post by:
Hi-- Please help. I need a code sample for bubble sort. Thank you. --Mark
171
by: tshad | last post by:
I am just trying to decide whether to split my code and uses code behind. I did it with one of my pages and found it was quite a bit of trouble. I know that most people (and books and articles)...
17
by: tshad | last post by:
Many (if not most) have said that code-behind is best if working in teams - which does seem logical. How do you deal with the flow of the work? I have someone who is good at designing, but...
2
by: emily224 | last post by:
Hello, I have been trying to understand this source code, which I retreived from my online course test. I would like to know how to find the answer for the question on the test. Im sure the answer...
4
by: emily224 | last post by:
Hello, I have been trying to understand this source code, which I retreived from my online course test. I would like to know how to find the answer for the question on the test. Im sure the answer...
8
by: Andy B | last post by:
Before I do a no no on a newsgroup, I need to ask a question: What is the max number of lines of code you can/should post here before it gets too long?
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.