XSL-How to get value of a variable from inside loop-- to the outside loop?
Pls help
hi im currently working on this xsl file..
This works on generating a txt file,my problem right now is
' how can i get the value of a variable generated from the inside forloop,
i have to get the total,sum value of this variables after performing the loop
***this is the for loop
<xsl:for-each select="OutboundPayment">
<xsl:variable name='id' select='generate-id(OutboundPayment)'/>
<xsl:sort select="PaymentNumber/CheckNumber" data-type="text" />
<xsl:variable name='PValue' select='format-number(100*PaymentAmount/Value,"0000000000000")'/>
<xsl:value-of select='$id'/>
<xsl:text>D</xsl:text>
<xsl:value-of select='$DDate'/>
<xsl:value-of select='$Batch'/>
<xsl:text>3</xsl:text>
<xsl:value-of select='format-number(PaymentNumber/PaymentReferenceNumber,"0000000000")'/>
<xsl:value-of select='format-number(PayeeBankAccount/BankAccountNumber,"0000000000")'/>
<xsl:value-of select='substring(Payee/Name,1,20)'/>
<xsl:value-of select='$PValue'/>
<xsl:variable name='Addend' select='concat($DDate,substring($DAcct,5,5),$Batch)'/>
<xsl:variable name="LHash">
<xsl:call-template name="GetHash">
<xsl:with-param name="A1" select="$PValue" />
<xsl:with-param name="A2" select="$Addend" />
</xsl:call-template>
</xsl:variable>
<xsl:value-of select="concat('[',$LHash,']')" />
<!--LHash*i have to get the total amount of this one from the outside loop /---->
<xsl:call-template name='NewLine'/>
</xsl:for-each>
<!--I have to put in here the total value of that LHash/---->
<!--This is the template on how to get the value of that variable in the inside loop/---->
<xsl:template name="GetHash">
<xsl:param name='A1'/>
<xsl:param name='A2'/>
<xsl:variable name='TwoSum' select='format-number($A1+$A2,"000000000000000")'/>
<xsl:variable name='Weight' select='317191314191112'/>
<xsl:call-template name="WDigit">
<xsl:with-param name="Cnt" select="15"/>
<xsl:with-param name="Sum" select="$TwoSum"/>
<xsl:with-param name="Wgt" select="$Weight"/>
<xsl:with-param name="Tot" select="0"/>
</xsl:call-template>
</xsl:template>
<xsl:template name='WDigit'>
<xsl:param name='Cnt'/>
<xsl:param name='Sum'/>
<xsl:param name='Wgt'/>
<xsl:param name='Tot'/>
<xsl:choose>
<xsl:when test="$Cnt > 0">
<xsl:variable name='Multip' select='substring($Wgt,$Cnt,1)'/>
<xsl:variable name='Factor' select='substring($Sum,$Cnt,1)'/>
<xsl:variable name='Prduct' select='$Multip$Factor'/>
<!--xsl:value-of select="concat($Tot,'[',$Cnt,']')"/-->
<!--xsl:value-of select="concat($Multip,'x',$Factor,'=',$Prduct)"/-->
<!--xsl:call-template name='NewLine'/-->
<xsl:call-template name="WDigit">
<xsl:with-param name="Cnt" select="$Cnt - 1"/>
<xsl:with-param name="Sum" select="$Sum"/>
<xsl:with-param name="Wgt" select="$Wgt"/>
<xsl:with-param name="Tot" select="$Tot+$Prduct"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="Rem" select="$Tot mod 11"/>
<xsl:variable name="Chk" select="11 - $Rem"/>
<xsl:value-of select="format-number(concat($Tot,$Chk),'00000')"/>
</xsl:otherwise>
</xsl:choose>
<xsl:template name='GetTotal'>
</xsl:template>
Thanks in advance for those who are willing to help.
-Leighya
It would have helped if you had posted your code as CODE but as it is, I could hardly read it. My guess about what you are asking is, if you want a template to return a value, just write that value to the result stream inside the template.
If that wasn't what you were asking, then please post your code in a readable format.
Similar Messages
-
How to get value on jsp file from ActionServlets class
Hi All,
I am facing problem in action servlets class into Struts, I am able to get the value on jsp file from action class with the help of session scope but i want to another method for it , so how i can solve the problem.Plz help me
Thanks......... in advanceI got a way out to access the attribute, i feel it is
<jsp:usebean id="myRack" class="settings.Rack"/>
<c:foreach var="book" item="myRack.books">
</c:foreach>
I am not able to check if this is correct or not because myRack.books is not having any value set by me in the request scope. How do i get instance of Rack class set by another page in the current request? I can get the value if i use scriptlet but i dont want to use scriptlet.
I am continiously trying, if I get an answer, I shall post, else pls somebody guide. -
How to get value of process variable in another flex form
Hi,
currently we are using Flex 3 for form development in LiveCycle ES workspace.
We have got an "Assign Task" service operation. This service operation has got a process variable defined for "input" and "output".
The service will be called in a flex form. When the process is called a task will be sent to a user.
When the user opens this task another flex form will be opened. All these steps work fine!
How it's possible to get the value of the defined process variable from the first flex form (which starts the process)
to the flex form which will be displayed when the user opens the task?
Thanks very much for your help!
HolgerSolutions:
-The 'proper' way for application specific stuff is to use a properties file, not env vars.
-Use System.getenv(), only works for versions before 1.3
-Use the java command line option '-D'
-Use Runtime.exec(), similar to the way you suggested.
-Use JNI. -
How to get value od one variable baesd on another variable
Hi Gurus,
Is this thing possible?My problem is i have one variable on "0calmonth2" based on this variable i want to populated the values in another object (0calquarter).i.e.
If i select " Jan or Feb or Mar" it should populate 1 in 0calquarter similarly, for other monthHello Deepak
Try a function module like this:
FUNCTION Z_YOUR_FM.
""Interfase local
*" IMPORTING
*" VALUE(I_AREA) TYPE UPC_Y_AREA
*" VALUE(I_VARIABLE) TYPE UPC_Y_VARIABLE
*" VALUE(I_CHANM) TYPE UPC_Y_CHANM OPTIONAL
*" VALUE(ITO_CHANM) TYPE UPC_YTO_CHA
*" EXPORTING
*" REFERENCE(ETO_CHARSEL) TYPE UPC_YTO_CHARSEL
*" EXCEPTIONS
*" FAILED
clear export table
CLEAR eto_charsel.
data: i TYPE i value 1,
ls_charsel TYPE upc_ys_charsel,
l_periv type periv value 'K1',
l_calmonth2 type UMC_Y_ICHAVAL,
l_buffer_call TYPE boole-boole VALUE ' ',
l_subrc LIKE sy-subrc,
ls_return LIKE bapiret2,
l_type LIKE upc_var-vartype,
lto_varsel_all TYPE upc_yto_charsel,
lto_varsel TYPE upc_yto_charsel,
lto_chanm TYPE upc_yto_cha,
wa_varsel like line of lto_varsel,
l_quarter(1),
l_quarterc(5).
Read value of CALMONTH2 variable
CALL FUNCTION 'Z_VARIABLE_GET_DETAIL'
EXPORTING
i_area = <YOUR PLANNING AREA>
i_variable = <YOUR CALMONTH2 VARIABLE>
i_buffer = l_buffer_call
IMPORTING
e_subrc = l_subrc
es_return = ls_return
e_type = l_type
eto_varsel_all = lto_varsel_all
eto_varsel = lto_varsel
eto_chanm = lto_chanm.
IF l_subrc eq 0.
loop at lto_varsel into wa_varsel.
move wa_varsel-low to l_calmonth2.
endloop.
ENDIF.
calculate quarter
CASE l_calmonth2.
WHEN '01' OR '02' OR '03'.
l_quarter = '1'.
WHEN '04' OR '05' OR '06'.
l_quarter = '2'.
WHEN '07' OR '08' OR '09'.
l_quarter = '3'.
WHEN '10' OR '11' OR '12'.
l_quarter = '4'.
ENDCASE.
passing QUARTER to variable value
CLEAR ls_charsel.
ls_charsel-CHANM = I_CHANM.
ls_charsel-SEQNO = i.
ls_charsel-sign = 'I'.
ls_charsel-opt = 'EQ'.
ls_charsel-low = l_quarter.
INSERT ls_charsel INTO TABLE eto_charsel.
add 1 to i.
ENDFUNCTION.
Hope this helps...
regards,
Ibrahim. -
How do I get values into a vi from a subvi while the subvi is still running within the vi?
Hello
This is my problem. I have a subvi that runs an experiment. At different point in the experiment different instruments are on or off and I have a boolean array display this info. It is updated at various points of the experiment via a local variable. That works fine. Here is the problem though. I run that subvi from a main vi program (that runs it several times for several experiment cycles). I would like to pass the status of that array onto the mainvi to display there too. The problem is that the array in the main vi is not updated until the subvi is done running and thus displays only the array status at end of experiment (instead of changing
as the status changes within the subvi). I tried using a global variable to write to it in the subvi every time there is an update, and read from it in the mainvi, but that doesn't work, it still displays just the status at the end of the subvi execution. Does anyone know how to make this work, or if there is a workaround this? Thanks.If you have LabVIEW 6i, you can update indicators of a calling VI from
a SubVI, while the subVI is running.
In your case you need
1) an indicator on the main VI panel to display the boolean array
2) to pass a reference to that indicator to the subvi when you call it
3) to use this reference in the subVI, connect a property node to it and
write the values to be displayed to the 'value' property of this node
If you don't have version 6, you can write the values to be displayed to
a global and display this global in the main VI from within a while loop
which must run in the main VI in parallel to the running subVI.
It's more complicated, since you need a mechanism to gracefully shut
down the while loop after subVI finishes. You could do this with
another global control boolean which is not displayed but just connected
to the repeat terminal of the while loop. Don't forget to put a 'Wait' of,
say, 50...100 msec in that while loop.
-Franz
zkajan schrieb:
> Hello
> This is my problem. I have a subvi that runs an experiment. At
> different point in the experiment different instruments are on or off
> and I have a boolean array display this info. It is updated at
> various points of the experiment via a local variable. That works
> fine. Here is the problem though. I run that subvi from a main vi
> program (that runs it several times for several experiment cycles). I
> would like to pass the status of that array onto the mainvi to display
> there too. The problem is that the array in the main vi is not
> updated until the subvi is done running and thus displays only the
> array status at end of experiment (instead of changing as the status
> changes within the subvi). I tried using a global variable to write
> to it in the subvi every time there is an update, and read from it in
> the mainvi, but that doesn't work, it still displays just the status
> at the end of the subvi execution. Does anyone know how to make this
> work, or if there is a workaround this? Thanks.
Franz Josef Ahlers
Section Semiconductor Devices
Physikalisch-Technische Bundesanstalt
Bundesallee 100
D-38116 Braunschweig
phone: (+49) 531 592 2410
fax: (+49) 531 592 2405 -
Jsp:usebean How to get value of an object from a bean
I am new to JSP and am struggling from past few days to solve a problem. Consider the below scenario
Class Book{
private String author;
public void setAuthor(String author)
public String getAuthor(){
return author; }
Class Rack{
private Book []books;
public []Book getbooks()
return books;
public void setbooks([]Book val){....}
Suppose Books gets populated only using Rack and I have Rack populate in my session, using jsp:usebean or any other tag how can I get value of author? Does using tag handle null value check of books, if books are not set by any chance?
Regards,
DhyanI got a way out to access the attribute, i feel it is
<jsp:usebean id="myRack" class="settings.Rack"/>
<c:foreach var="book" item="myRack.books">
</c:foreach>
I am not able to check if this is correct or not because myRack.books is not having any value set by me in the request scope. How do i get instance of Rack class set by another page in the current request? I can get the value if i use scriptlet but i dont want to use scriptlet.
I am continiously trying, if I get an answer, I shall post, else pls somebody guide. -
How to get value in backing bean from application module
Hi all.. I'm new in jdeveloper and adf..
I need to use value from backing bean and use that value in application module.
But I don't know how to get it.
Do you a have any solution?suppose you have myMethod(String argumentName1,String argumentName2) in your Application Module
then to access a method binding from a managed bean, use the following code,
BindingContext bctx = BindingContext.getCurrent();
BindingContainer bindings = bctx.getCurrentBindingsEntry();
OperationBinding operationBinding =
bindings.getOperationBinding("name_of_method_binding");
//Here you can pass the parameters value to the AM method
operationBinding.getParamsMap().put("argumentName1",value1);
operationBinding.getParamsMap().put("argumentName2",value2);
//invoke method
operationBinding.execute();
if (!operationBinding.getErrors().isEmpty()) {
//check errors
List errors = operationBinding.getErrors();
//optional
Object methodReturnValue = operationBinding.getResult(); -
How to get value object (entity abject) from ViewObject?
How to get data from ViewObject in the form of value object? I know BC4J creates entity object for database table/view (looks like value object) but I did not find api to get entity object from ViewObject.
Thanks.BC4J provides an implementation of the value object design pattern for you, so you don't have to waste time writing your own.
I wrote a whitepaper illustrating how to take advantage of this at:
Implement Collections of Value Objects for MVC Apps with BC4J
This allows clients (like a servlet, a JSP, a Swing client, etc.) to get value objects from the collection of value objects that BC4J supports.
However, if you are writing code inside your view object implementation class and want to access the entity object, just call the accessor that we generate into your view row implementation class for you. For example, for a VO named EmployeeView that uses an entity object named Employee, there will be a private accessor method getEmployee() that will give you the entity. -
How do i get value of Environment variables from a java program?
Hai,
I have a setup file wherein i set the path for the root directory , in the following way.
setenv TPEROOT "/home/systpe/khurram/changes"
when i give echo $TPEROOT
the path , home/systpe/khurram/changes , is displayed on the console
If i want to assign the $TPEROOT to a string variable str in my java program , then how can i do it.
I want to use the value of the environment variable in my program.
Any help in this regard would be very useful
Thanks
khurramjava -DTPEROOT=$TPEROOT myőackage.myclass myargs
-
How to set values to bpel variables from Java
I have a java class to create files and populate some contents into it. On success it returnes "File Created"
I used the following code to achieve it :-
WriteFiles objWriteFiles=new WriteFiles();
String para=((oracle.xml.parser.v2.XMLElement)getVariableData("inputVariable","payload","/client:FileTestProcessRequest/client:HO_ORG_ID")).getFirstChild().getNodeValue();
String result=objWriteFiles.writeHeaderInfo(para);
(writeHeaderInfo is a method in my java class)
addAuditTrailEntry(result);
I works fine..Now I want to assign this reult value to a bpel variable .. I tried doin it like below:-
setVariableData("outputVariable","payload","/client:FileTestProcessResponse/client:result" , result)
but its not working...I get a fault ...
Can anyone help me out...
Thanks,
Githa.R.SIn this example :
<!-- Invoke the EmployeeStatus Java class instead of web service -->
<bpelx:exec name="invokeJavaExec" language="java" version="1.4">
<![CDATA[
EmployeeStatus e = new EmployeeStatus();
String firstName = ((Element)getVariableData(
"EmployeeTravelStatusRequest", "employee",
"/employee/FirstName")).getNodeValue();
String lastName = ((Element)getVariableData(
"EmployeeTravelStatusRequest", "employee",
"/employee/LastName")).getNodeValue();
String empStatus = e.getTravelStatus(firstName, lastName);
addAuditTrailEntry("Employee status is: " + empStatus);
setVariableData("EmployeeTravelStatusResponse", "travelClass",
"/travelClass", empStatus);
]]>
</bpelx:exec>they dont use namespaces in the xpath-expression, can you try that ? -
How to get value in dashboard prompt from database
Hi All,
I am using dashboard prompt (Year Prompt) to filter reports on year basis.
fact table stores the hit date on a particular site linked with date dimension table .
I have Datas in fact table say from year 2005 to 2009 .In dashboard Prompt it is showing me all the years 1990 to 2021(that are in date dimension).
I hard coded the value of years in prompt now it only showing me years 2005 to 2009.
My question is that is their any way that prompt automatically take values from database, those years which are stored in fact table ?
Thanks in advance.Hi...
Try writing query for dashboard prompt to get desired values..
*select distinct year(FactTable.HitDate) from SubjectAreaName*
To work this.. you should have HitDate column in presentation layer. (You can drag this column from fact in BMM and drop in any dimensions of presentation Layer, and name it as HitDate (Fact).. some thing like this... -
How to get value of some key from Registry Edit in a Java class?
Hi,
I want to write a program which needs to access the value for HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment\1.6.0\MSI' paths 'INSTALLDIR' key's value.
Does anybody have pointers on this?
Thanks In Advance,
Kalyani.....hi,
this is the code i am employing and i want to know why i am failing:
import com.ice.jni.registry.Registry;
import com.ice.jni.registry.RegistryException;
import com.ice.jni.registry.RegistryKey;
import com.ice.jni.registry.RegStringValue;
import com.ice.jni.registry.RegistryValue;
* @author ayesha
public class ReadingRegistryValueFromRegistry {
private static String TOP_KEY_NAME="HKEY_LOCAL_MACHINE";
private static String KEY_NAME="SOFTWARE\\JavaSoft\\Java Development Kit\\1.5.0_08 ";
private static String ARG_KEY="JavaHome";
* @param args
public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.println(getGMDBPathFromRegistry()+"111111111111111111111111111111111111111111111111111111111");
private static String getGMDBPathFromRegistry(){
String gmDBPath=null;
RegistryKey topKey=null;
String topKeyName=TOP_KEY_NAME;
//System.out.println(topKeyName+"33333333333333333333topkeyname");
String keyName=KEY_NAME;
//System.out.println(keyName+"5555555555555555555555555555555keyName");
String argKey=ARG_KEY;
//System.out.println(argKey+"66666666666666666666666666666666666666666666666666666666argKey");
topKey=Registry.getTopLevelKey(topKeyName);
System.out.println(topKey+"somethingsomething");
if(topKey==null){
return gmDBPath;
RegistryKey subKey=Registry.openSubkey(topKey,keyName,RegistryKey.ACCESS_READ);
try{
System.out.println(subKey.toString()+"value i got in here");
catch(Exception e){
System.out.println(e.getCause().toString());
if(subKey==null){
return gmDBPath;
try{
gmDBPath=subKey.getStringValue(argKey);
catch(RegistryException ex){
return gmDBPath;
return gmDBPath;
I want to read from the registry entry the value of java.
Any suggestions are eagerly awaited.
ayesha. -
How to get value of a structure from a standrd program to Z program
There is a standard program which generates a file when it is run a file is created
The name of the file is stored in a structure. I am submitting this standard program in my Z program I have to get the file name from the structureHi,
Does this help?
you can retrieve the content of a structure from another shared memory by assigning it with a field symbol:
e.g.
FIELD-SYMBOLS: <staffel> TYPE table.
* get itab data from SAPMV13A
ASSIGN ('(SAPMV13A)STAFFEL[]') TO <staffel>.
Kind regards, Rob Dielemans -
How to get out of recovery mode from a problem in the blackra1n jailbreak
I recently tried to jailbreak my iPhone 5c with the blackra1n app on my mac. It did not work for my iPhone 5c because it was put in recovery mode. What are some methods to get out of recovery mode besides holding the power and home button for ten seconds?
You need to put in in DFU mode (Google it) and Restore it as a new iPhone to get out of that jailbreak.
-
How to get value in showModalDialog()
Hi,
I would like to know how to get value pass into showModalDialog() to be used by the server (using request.getParameter())
TQplease try out this kind of code
<script language="javascript">
function trial(){
var retVal = new Object();
retVal = ShowModalDialog("ur JSp");
</script>
<script>
<form >
<input type="hidden" name ="mylink "value= javascript:trial();>
</form>
<%
String str=request.getParameter("mylink");
%>
and plz let me know .. if it works
Maybe you are looking for
-
Hi all, I have a scenario in which i am sending an IDoc to a Oracle Table. This sends back an acknowledgement to an HTTP Receiver which is finally sent as an ALEAUD Idoc to the sender system. The data is getting posted to the table and the acknowledg
-
Hello, I would like to group concat my data : instead of having : Here's my output data : ID | Brand 55 | Xcel 55 | DCS I would like to get : ID | Brand 55 | XCEL, DCS but when I'm using the function wm_concat or group concat I've an error message. T
-
Laserwriter NTR Prints VERY LARGE Characters
The NTR is connected to a Sun machine running solaris. It prints fine from the Sun. On the imac running SL when I print the size of the characters is very large. IIRC this started after installing SL. I have reset the print system to no avail. The pr
-
Too many touch points reported: Bug ?
Dear JavaFX community Following situation. I have a touch handler who recognizes special gestures and fires javafx.GestureEvent derivates on positive detection. the gesture event carries a list of cloned touch points for carrying the touches on start
-
LabVIEW 8.6 + SourceGear Vault is not working
Hi there, when I try to configure LabVIEW with Vault as source control client i get the error message "2972 - An internal error occured during the source control operation." (see picture) So, what causes the problem and how can i configure the source