473,699 Members | 2,838 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

xsl code question

Hi,

I am trying to produce the following in javacode;

public void action<An actionName>(Str ing value1, int value
2....,Coordinat or 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>
<raisesExceptio n name="InternalE rrorException"/>
<raisesExceptio n name="MoDisable dException"/>
<raisesExceptio n name="AlreadyAc tiveException"/>
</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="returnTyp e/void">
public void action<xsl:call-template name="CapFirstL etterOfAttr">
<xsl:with-param name="x"
select="@name"/></xsl:call-template><xsl:i f test="parameter ">
<xsl:for-each select="paramet er">
<xsl:apply-templates select="paramet er"/>
</xsl:for-each>
</xsl:if>
(Coordinator c) throws MoAccessExcepti on<xsl:if
test="raisesExc eption">
<xsl:text>,</xsl:text></xsl:if><xsl:tex t>
</xsl:text><xsl:f or-each select="raisesE xception"><xsl: value-of
select="@name"/>
<xsl:if test="not(posit ion()=last())"> ,<xsl:text>
</xsl:text> </xsl:if></xsl:for-each>;
</xsl:when>
<xsl:when test="returnTyp e/structRef">
public Struct action<xsl:call-template name="CapFirstL etterOfAttr">
<xsl:with-param name="x"
select="@name"/></xsl:call-template>(Coord inator c) throws
MoAccessExcepti on<xsl:if test="raisesExc eption">
<xsl:text>,</xsl:text></xsl:if><xsl:tex t>
</xsl:text><xsl:f or-each select="raisesE xception"><xsl: value-of
select="@name"/>
<xsl:if test="not(posit ion()=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="paramete r">
<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 1618

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

Similar topics

3
5190
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 using check boxes. For example, a question such as
70
2593
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
1763
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 below works but I just keep looking at it and thinking that there should be some way to compact it. There are 10 ImagePages and the only difference is their name propertie. i.e. ImagePage1, ImagePage2,
67
4258
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. Unfortunately these ad hominem rhetorts are frequently introduced into purely technical discussions on the feasibility of supporting such functionality in C++. That usually serves to divert the discussion from the technical subject to a discussion of the...
34
7309
by: Mark Kamoski | last post by:
Hi-- Please help. I need a code sample for bubble sort. Thank you. --Mark
171
7723
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) like it because you can split the code from the design. That is logical. But if you are the only one working on the code, it seem a little overkill. I use Dreamweaver to do my design and find it a bit of a hassle to have multiple files open...
17
2701
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 know nothing about ASP. He can build the design of the pages in HTML with tables, labels, textboxes etc. But then I would need to change them to ASP.net objects and write the code to make the page work (normally I do this as I go - can't do this...
2
5079
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 must be embedded somewhere in the source code, and I would like to know if anyone knows where to find the correct answer. I would greatly appreciate it!! Thanks!! <!--put the preloads file here as it must load before the website class...
4
68230
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 must be embedded somewhere in the source code, and I would like to know if anyone knows where to find the correct answer. I would greatly appreciate it!! Thanks!!
8
1246
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
8685
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9171
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9032
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8905
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8880
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6532
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4373
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4625
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2008
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.