XSL Append & XSL Variable !!!

Hi,
If anyone has any ideas on the below problem I would sincerely appreciate it as it is driving me crazy!!!
I need to concatenate/append the contents of a Collection node into a string variable, such that each element is comma seperated in the string. I need to do this to pass the string of comma seperated values into a 3rd party service that I am calling. It looks like I would use an XSL transform to achieve this. However, it appears to be impossible because Oracle Transform mapper does not support <xsl:variable> ie. I get "unsupported" when I try to use this.
So,for example, I want to convert the following collection
<NamesCollection>
<name>A</name>
<name>B</name>
<name>C</name>
<name>D</name>
<name>E</name>
<name>F</name>
<name>G</name>
<name>H</name>
</NamesCollection>
...such that it would become:
<NAMES>A,B,C,D,E,F,G,H</NAMES>
I found some sample XSL code in google:
<xsl:variable name="String">
<xsl:for-each select="/NamesCollection">
<xsl:value-of select="name" />
<xsl:text>,</xsl:text>
</xsl:for-each>
</xsl:variable>
However, Oracle mapper does not support "xsl:variable". So the above is no good.
I cannot also nest a "for-each" inside a node,
Eg.
<NAMES>
<xsl:for-each select="/NamesCollection">
<xsl:value-of select="name"/>
</xsl:for-each>
</NAMES>
because it complains:
Error: Invalid Usage of <for-each> Element
If anyone has any suggestions, they would be sincerely appreciated !!!!!!!!!

Humm...
You can iterate trough your NamesCollection (see <HOME>\integration\orabpel\samples\tutorials\112.Arrays sample).
After, for each <name>, you can use an "Assign" activity to append all names to another variable.
The trick here is to edit the "Assign" source code on process.bpel (because the default behaviour is to replace the value, not append). You have to use a BPEL extension:
<assign name="Assign_1">
<bpelx:append>
<bpelx:from concat(bpws:getVariableData(eachName_Variable),",") />
<bpelx:to variable="namesWithComma_Variable" />
</bpelx:append>
</assign>
Logic:
<IterateOver NamesCollection>
<get one name>
<concat it with a comma>
<concat it with other names>
<loop iterate>

Similar Messages

  • ItemStyle.xsl append site name to image

    Hi
    I've added a cqwp that fetches information from a list. One of the column (TestRelative) is set to hold only the image filename i.e. myImage.jpg
    I set the Image (in CQWP parameter settings) to  TestRelative.
    When the page renders the image doesnt show, i get the red X. Checking the image url in the browser I can see that the address is missing the current sitecollection and web. (http://server.com/imagelib/myimage.jpg)
    its supposed to read (http://server.com/sites/sc/imagelib/myimage.jpg) or if placed in a subsite then (http://server.com/sites/sc/subweb/imagelib/myimage.jpg)
    The SC and subweb are needed to be dynamic.
    Here is the partial xslt:
    <xsl:template name="customReImageLeft" match="Row[@Style='customReImageLeft']" mode="itemstyle">
    <xsl:variable name="SafeLinkUrl">
    <xsl:call-template name="OuterTemplate.GetSafeLink">
    <xsl:with-param name="UrlColumnName" select="'LinkUrl'"/>
    </xsl:call-template>
    </xsl:variable>
    <xsl:variable name="SafeImageUrl">
    <xsl:call-template name="OuterTemplate.GetSafeStaticUrl">
    <xsl:with-param name="UrlColumnName" select="'ImageUrl'"/>
    </xsl:call-template>
    </xsl:variable>
    <xsl:variable name="DisplayTitle">
    <xsl:call-template name="OuterTemplate.GetTitle">
    <xsl:with-param name="Title" select="@Title"/>
    <xsl:with-param name="UrlColumnName" select="'LinkUrl'"/>
    </xsl:call-template>
    </xsl:variable>
    <div class="item">
    <xsl:if test="string-length($SafeImageUrl) != 0">
    <div class="image-area-left">
    <a href="{$SafeLinkUrl}">
    <xsl:if test="$ItemsHaveStreams = 'True'">
    <xsl:attribute name="onclick">
    <xsl:value-of select="@OnClickForWebRendering"/>
    </xsl:attribute>
    </xsl:if>
    <xsl:if test="$ItemsHaveStreams != 'True' and @OpenInNewWindow = 'True'">
    <xsl:attribute name="onclick">
    <xsl:value-of disable-output-escaping="yes" select="$OnClickTargetAttribute"/>
    </xsl:attribute>
    </xsl:if>
    <img class="image" style="width:150px;height:150px" src="{$SafeImageUrl}" title="{@ImageUrlAltText}">
    <xsl:if test="$ImageWidth != ''">
    <xsl:attribute name="width">
    <xsl:value-of select="$ImageWidth" />
    </xsl:attribute>
    </xsl:if>
    <xsl:if test="$ImageHeight != ''">
    <xsl:attribute name="height">
    <xsl:value-of select="$ImageHeight" />
    </xsl:attribute>
    </xsl:if>
    </img>
    </a>
    </div>
    </xsl:if>
    <div class="link-item">
    <xsl:call-template name="OuterTemplate.CallPresenceStatusIconTemplate"/>
    <div class="customTitle">
    <xsl:value-of select="@Title" />
    </div>
    <br />
    <div class="customDescription">
    <xsl:value-of select="@Description" />
    </div>
    </div>
    </div>
    </xsl:template>

    Hi Orange,
    if i may know, the address shown from your code is only the filename, without full web/site URL yes?
    if you add a concat tag, will it help? for example:
    <xsl:value-of select="/*/properties/property[@name='report']/@value" />
    please check these 3rd party link example perhaps able to help you to have a workaround?
    http://blog.greenbrain.de/2014/07/configuring-content-query-webpart-to.html
    https://www.nothingbutsharepoint.com/sites/eusp/pages/how-to-customize-sharepoint-list-content-display-using-content-query-web-part.aspx
    Regards,
    Aries
    Microsoft Online Community Support
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

  • XSL-1009 XSL:Version

    The following xsl sample will translate with ORAXSL without errors in one of my docs:
    <?xml version="1.0"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:import href="../generic/parsePOHeader.xsl"/>
    <xsl:import href="../generic/parsePOLine.xsl"/>
    <xsl:output method="xml" indent="yes"/>
    <xsl:template match="/">
    <xsl:value-of disable-output-escaping="yes" select="'&lt;?soxtype urn:x-commerceone:document:com:commerceone:XCBL30:XCBL30.sox$1.0?&gt;'"/>
    <xsl:element name="Order">
    <xsl:element name="OrderHeader">
    <xsl:call-template name="parsePOHeader">
    <xsl:with-param name="HEADER" select="//POHEADER"/>
    <xsl:with-param name="ProcessPO" select="'Y'"/>
    </xsl:call-template>
    </xsl:element>
    <xsl:if test="count(//POLINE) &gt; 0">
    <xsl:element name="OrderDetail">
    <xsl:element name="ListOfItemDetail">
    <xsl:for-each select="//POLINE">
    <xsl:call-template name="parseLINE">
    <xsl:with-param name="LineItem" select="."/>
    </xsl:call-template>
    </xsl:for-each>
    </xsl:element>
    </xsl:element>
    </xsl:if>
    <xsl:call-template name="createOrderSummary">
    <xsl:with-param name="NumLines" select="count(//POLINE) + count(//POSUBLINE)"/>
    <xsl:with-param name="Amount" select="//POHEADER/OPERAMT[@qualifier='EXTENDED' and @type='T']"/>
    </xsl:call-template>
    </xsl:element>
    </xsl:template>
    </xsl:stylesheet>
    The following xsl with the same stylesheet statement errors out.
    <?xml version="1.0"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:import href="../generic/parsePOHeader.xsl"/>
    <xsl:import href="../generic/parsePOLine.xsl"/>
    <xsl:output method="xml" indent="yes"/>
    <xsl:template match="/">
    <xsl:value-of disable-output-escaping="yes"
    select="'&lt;?soxtype
    urn:x-commerceone:document:com:commerceone:XCBL30:XCBL30.so
    x$1.0?&gt;'"/>
    <xsl:element name="Order">
    <xsl:element name="OrderHeader">
    <xsl:call-template name="parsePOHeader">
    <xsl:with-param name="HEADER"
    select="//POHEADER"/>
    </xsl:call-template>
    </xsl:element>
    <xsl:if test="count(//POLINE) &gt; 0">
    <xsl:element name="OrderDetail">
    <xsl:element name="ListOfItemDetail">
    <xsl:for-each select="//POLINE">
    <xsl:call-template name="parseLINE">
    <xsl:with-param name="LineItem"
    select="."/>
    </xsl:call-template>
    </xsl:for-each>
    </xsl:element>
    </xsl:element>
    </xsl:if>
    <xsl:call-template name="createOrderSummary">
    <xsl:with-param name="NumLines"
    select="count(//POLINE) + count(//POSUBLINE)"/>
    <xsl:with-param name="Amount"
    select="//POHEADER/OPERAMT[@qualifier='EXTENDED' and
    @type='T']"/>
    </xsl:call-template>
    </xsl:element>
    </xsl:template>
    </xsl:stylesheet>
    ERROR:
    A nonfatal internal JIT (3.10.107(x)) error 'GetRegisterA' has occurred in :
    'oracle/xml/parser/v2/XSLNodeList.indexOf (Lorg/w3c/dom/Node;)I': Interpreting method.
    Please report this error in detail to http://java.sun.com/cgi-bin/bugreport.cgi
    oracle.xml.parser.v2.XSLException: XSL-1016: Extension function namespace should start with 'http://www.oracle.com/XSL/Transform/java/'.
    Error occurred while processing OAGIShowPONeal.xml: XSL-1016: Extension function namespace should start with 'http://www.oracle.com/XSL/Transform/java/'.
    I made the suggested change to the XSL
    <?xml version="1.0"?>
    <xsl:stylesheet xmlns:xsl="'http://www.oracle.com/XSL/Transform/java/" version="1.0">
    <xsl:import href="../generic/parsePOHeader.xsl"/>
    <xsl:import href="../generic/parsePOLine.xsl"/>
    <xsl:output method="xml" indent="yes"/>
    <xsl:template match="/">.
    And I get the following error:
    Error occurred while processing ORATransformShowPO.xsl: XSL-1009: Attribute 'xsl:version' not found in 'xsl:stylesheet'.
    I searched Technet.oracle.com for an explanation. According to Steve Muench, 7/24/2000, I need to use the following : <xsl:stylesheet version="1.0" xmlns:xsl=" " target="_new">http://www.w3.org/1999/XSL/Transform">
    This makes no sense because it has an odd number of quotes and > symbols but I tried it. I have the same error, again.
    Can anyone make sense of this?
    Big Hurrah for the solution!

    I typed the words "turn off jit" into Google and came up with a link like:
    http://java.apache.org/faq/fom-serve/cache/152.html
    that might help.

  • Xsl Problem( xsl:for-each .... )

    Hi
    I have Xml Dom Object which contain
    <Root>
       <CD>
          <Title>Empire Burlesque</Title>
          <artist>Bob Dylan</artist>
          <Price>10.50</Price>
       </CD>
    </Root> my XSL contain
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:template match="MPRoot">
      <html>
        <body>
        <h2>My CD Collection</h2>
        <table border="1">
          <xsl:for-each select="cd">
          <tr>
            <td><xsl:value-of select="title" /></td>
            <td><xsl:value-of select="artist" /></td>
            <td><xsl:value-of select="price" /></td>
          </tr>
          </xsl:for-each>
        </table>
      </body>
      </html>
    </xsl:template>
    </xsl:stylesheet> I m not getting My Desire Out put �
    I am getting all the Static Value which I have Written before (<xsl:for-each select="cd">) I have already try with (<xsl:for-each select="Root/cd"> and <xsl:for-each select="/cd"> and <xsl:for-each select="./cd">)
    Regards,
    Nilesh

    Your main template selects MPRoot elements. You don't have any MPRoot elements in your example XML. However let's suppose that your example XML is a lie and that those Root elements are MPRoot elements in real life. Then, your xsl:for-each selects cd elements. But your Root elements don't have any cd elements as children. They do have CD elements, though. So if that part of the example wasn't a lie, try <xsl:for-each select="CD"> instead.

  • Xsl:include xsl:import and clob

    I can use xslprocessor.processXSL to perform transformation where the XML and XSL are in CLOBs.
    However, is it possible to perform transformation if the XML and XSLs are in CLOBs and the XSL have xsl:include and xsl:import?
    Thanks and Regards,
    Andy

    It will be supported in later release.

  • Problems with the xsl element ---- xsl:output method="xml"/ ----

    Hy, my problem is the next, I am trying to read a xml file and transform it in itself but when I do with XSLT, Internet Explorer doesnt show a xml file, just show me the text nodes of the xml file. I have the element <xsl:output method="xml"/>" in the xsl file but I dont Know what Iam doing wrong.
    The next code is from the xsl file:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="xml"/>
    <xsl:template match="/">
    <xsl:copy-of select="catalog"/>
    </xsl:template>
    </xsl:stylesheet>
    The next code is from the xml file:
    <?xml version="1.0" encoding="UTF-8"?>
    <!-- Edited with XML Spy v2007 (http://www.altova.com) -->
    <?xml-stylesheet type="text/xsl" href="PlantillaXSL.xml"?>
    <catalog dni="4546545">
         <cd numero="2" id="5" color="red">
              <title>Empire Burlesque</title>
              <artist>Bob Dylan</artist>
              <country>USA</country>
              <company>Columbia</company>
              <price>10.90</price>
              <year>1985</year>
         </cd>
    </catalog>
    The result in internet explorer is:
    Bob Dylan USA Columbia 10.90 1985

    All right. I asked because it's unusual to use the ".xml" extension for an XSL file, so I thought it might be an error. But there's nothing wrong with that.
    Next debugging step: is that XSL file actually being used? Insert some debugging code in it so that you can tell.

  • How to resolve Error: "xsl:import" XSL Element Currently not Supported

    Hello Everyone,
    I have a xsl in my process to perform transformation of source schema to target schema.
    This xsl is importing another xsl.
    I am using <xsl:import> for this purpose.
    But when I try to see the "design" editor I am getting the error given below:
    Error: "xsl:import" XSL Element Currently not Supported
    In "source" editor JDeveloper is giving no error.
    I request you all to please come forward for the rescue ;-)
    Thanks in advance.
    Regards,
    Shanty

    I think the error message is telling you that the visual design surface that simplifies creating transforms doesn't support the <xsl:import>. If you need to use <xsl:import>, and assuming that <xsl:include> (which is quite similar to import) is also not supported, then the only other option is working on the XSLT stylesheet in the source editor.

  • How do I generate HTML from XML & XSL using XSL Processor ?

    I want to generate a HTML from XML & XSL using XDK for C on
    linux-8i.
    I run the XSLSample well.
    But it only generate a XML from a XML & a XSL.
    Can any one give me some advise or sample code?

    Just use HTML tags instead of xml tags in your stylesheet, and
    you'll generate HTML instead.
    <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
      <xsl:template match="/">
        <html>
          <body>
            <xsl:for-each select="ROWSET">
              <table border="1" cellspacing="0">
                <xsl:for-each select="ROW">
                  <tr>
                    <td><xsl:value-of select="EMPNO"/></td>
                    <td><xsl:value-of select="ENAME"/></td>
                  </tr>
                </xsl:for-each>
              </table>
            </xsl:for-each>
          </body>
        </html>
      </xsl:template>
    </xsl:stylesheet>

  • How can i append the variable to filename in import statement?

    how can i append variable(substitution variable) to file name in import command for maxL?
    example : For suppose there is a file like "dataload.txt" and a variable like cur_month(august).How can i rename the file like daload_august in import statement.
    Edited by: 788996 on Aug 22, 2010 11:18 PM

    Are you saying you want to use an OS level environment variable in a MaxL statement to substitute for an entire file name? I am going to illustrate Windows, but do it your own way in *nix if you want.
    YourCallingCode.cmd
    REM Note the \\ and then the \\, you had \\ and \
    SET curmon=c:\\ABC\\datafile_21_AUG.txt 
    REM Call MaxL with a paramenter
    startMaxL.cmd DoItForTheCurrentMonth.msh %curmon%DoItForTheCurrentMonth.msh
    login blah blah for blah ;
    import database appname.dbname data from local text data_file $curmon using server rules_file "rulefile"
         on error abort ;The trick is to change whatever's in % and % and replace it with a $ in the MaxL script.
    I gave a presentation last year on MaxL at ODTUG Kaleidoscope. If you go to http://www.odtug.com, then Tech Resources, then Essbase, then search on my name, you'll find "Master Essbase with MaxL Automation". More than you could ever want to know about MaxL, variables (parameter, environment, and explicitly declared), scripting, etc., etc., are all there for the taking. If you're not already a member, you'll have to join, but an associate membership is free. You can then download my presentation and all of the others. It is a treasure chest of technical tips and knowledge.
    Yes, I am a fan a member of the Hyperion SIG, so I am ever so slightly biased. Regardless, it is good information, for free.
    Regards,
    Cameron Lackpour
    Edited by: CL on Aug 24, 2010 5:33 AM
    If you want to substitute part of the data file name, you can do that too:
    set curmon=21_AUG
    Your MaxL statement would look like:
    import database appname.dbname data from local text data_file "c:\\ABC\\datafile_$curmon.txt" using server rules_file "rulefile"
         on error abort ;

  • Convert xsl and xsl to pdf

    Hi,
    In our project, we generate reports using xalan parser in PDF and HTML formats. Now, my client wants them to be generated in RTF (Ms Word) format as well. As this is not possible using xalan, I tried to find out other parsers. I found one JFOR which generates RTFdocs from XSLFO. What I have is only XML and XSL documents. How can I get XSLFO document using these two? Is there any parser which generates XSLFO docs using XML and XSL? Or is there any parser which generates RTF docs directly from XML and XSL?
    Thanks
    Jagadeesh

    As this is not possible using xalanWhy is it not possible? RTF is a text format as far as I know, and you can output text from XSLT.

  • XSL Error: XSL Map generation failed

    When i try to open the xsl-design window i get the error
    Error: XSL Map generation failed. Please use the source editor.....
    When i switch to the source editor, i have a red box in the scroll bar. This has a tooltip with:
    "Obligatorisches Attribut version fehlt in Element xsl:stylesheet"
    translated:
    "obligatory attribut version is missing in element xsl:stylesheet"
    I get this error on every xsl map. New generated and others which has worked... Does anybody know, how to fix this?

    Hi HEWizard ,
    I am also facing similar issue,i am not able to open my xsl with ide.
    i am seeing XSL Map generation Failed error for all my XSL :( even all new XSL as well.
    how did you solve this problem,
    Any pointers.
    Thanks,
    Murali

  • How do you override global variable values when calling oraxsl or xsl.exe?

    I am a newbie to oracle xslt.
    I have down loaded the latest version of xdk (10.1.0.2...). (Jan 2, 2009).
    In the past I haveI used micorsoft's "msxsl.exe" to perform my transformations.
    I am looking for a more up-to-date transformation tool.
    I found Oracle's version, and thought I would try it out.
    I have run the "bin/xsl.exe -hh" command.
    I read its help data. It states that variables are
    passed by coding a pramater "-V <var> <value>".
    I have also examined the oraxls.bat file.
    I found the documentation on "oracle.xml.parser.v2.oraxsl" class.
    It states that parameters are passed after the "-p" switch.
    It says the value of the -p parameter is "a list of paramemters".
    I don't find this sufficient information to be useful.
    I can spend days guessing, and I might get lucky.
    I thought it my be better to ask for help.
    I need to pass in (override) values for 3 global variables.
    I saw the method
    "setParam(namespace, variable, value)",
    near the documentation for the "oraxsl" class.
    How do you format the options string to communicate more than one param statement?
    (in either xsl.exe and/or oraxsl class).
    Suppose I have an xslt stylesheet as follows:
    ==================================================
    <?xml version="1.0" ?>
    <xsl:stylesheet version="1.1" xmlns:xsl='http://www.w3.org/1999/XSL/Transform' >
    <xsl:param name='a' select='"default_a"' />
    <xsl:param name='b' select='"default_b"' />
    <xsl:param name='c' select="'default_c"' />
    <xsl:template match='/'>
    this is value for a: <xsl:value-of select='$a' />
    this is value for b: <xsl:value-of select='$b' />
    this is value for c: <xsl:value-of select=$c' />
    <xsl:apply-templates />
    </xsl:template>
    </xsl:stylesheet>
    ========================================================
    Now as part of the calling of the XSL processor I want to change the value of these
    three global parameters.
    I want:
    a="current_a",
    b="current_b",
    and c="current_c"
    How do I express this using xsl.exe and its paramter string (-V ????).
    and/or how do I express it to the oraxsl class ( -p (xsl, a,"current_a"), (....) )???
    The syntax for specifying this information is not very clear in either situation.
    Of course I am making the "assumption" that by "param" they are
    refering to "global parameters" (as in my stylesheet), rather than some other global parameters of XLST.
    As an aside inquiry:
    I had hopped that the Oracle's xsl Verion 2 routine could handle xslt 2.0 commands
    such as "xsl:for-each-group", since it handled multiple xsl:outputs.
    From reading some of the documentation it seems it only handles xslt 1.0 syntax/commands.
    Is this true? (or is the documentation not up-to-date?).
    Any help on passing param values to xsl.exe and/or "oraxsl" class is appreciated.
    Thanks.

    Here is the line from one of my testing .bat files that passed in one parameter. I can't recall if I've passed in two, but this will give you a starting point for passing in multiple
    java -cp %CPath% oracle.xml.parser.v2.oraxsl -p show_image='yes' %ValXML% %ValXSLT% As for XSLT 2.0 support, it appears it does per {thread:id=503445}

  • How to use xsl-variables

    I have the following piece of code. The numbers are the number of the code lines.
    In line 17 I want to assign a value to the attribute value of the node options. The value should be the value of the xsl-variable "wildart" which i declared in line 7. How can use the value of this variable in line 17 correctly?
    1     String xsl =
    2      + "<form name=\"wildart\" action=\"/servlet/model/ServletTransformerTest\"  method=\"post\">"
    3      + "<select name=\"wildart\" onChange=\"form.submit()\">"
    4      + "<option>Bitte Ausw�hlen</option>"
    5      + "<xsl:for-each select=\"//tier\">"
    6      + "<xsl:sort select=\"@wildart\" data-type=\"text\"/>"
    7      + "<xsl:variable name=\"wildart\" select=\"@wildart\"/>"
    8      + "<xsl:variable name=\"name\" select=\"@name\"/>"
    9      + "<xsl:variable name=\"anzahl\" select=\"count(//tier[@wildart=$wildart])\"/>";
    10                
    11     if(optionSelected == null) {
    12
    13        xsl = xsl           
    14        + "<xsl:for-each select=\"//tier[@wildart =$wildart]\">"
    15        + "<xsl:if test=\"position()=last()\">"
    16        + "<xsl:if test=\"@name=$name\">"         
    17        + "<option value=\"$wildart\">"
    18        + "<xsl:value-of select=\"@wildart\"/>"
    19        + "</option>"
    20        + "</xsl:if>";
    21     }

    use : "<option value=\"{$wildart}\">"

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

  • Unable to display a variable value in xml through xsl using coldfusion

    Hi ColdFusion Heroes ,
    Is their any one to help me in this issue . I am new to cold
    fusion , XML and XSL .
    Detail Explaination :
    develoment_files.cfm is a .cfm page , which includes an xml
    page .
    development_files_dropdown.xsl is a xsl page .
    develoment_files.cfm : Code is as follows .
    <CFDIRECTORY ACTION="LIST" DIRECTORY="#somepath#"
    NAME="DirContents" FILTER="p*">
    <CFQUERY DBTYPE="query" NAME="Files">
    SELECT *
    FROM DirContents
    WHERE Type = 'File'
    </CFQUERY>
    <CFOUTPUT><?xml version='1.0' encoding='UTF-8'?>
    <?xml-stylesheet type="text/xsl"
    href="../XSL/development_files_dropdown.xsl"?>
    <Test xmlns:xsi='
    http://www.w3.org/2001/XMLSchema-instance'>
    <CFLOOP QUERY="Files">
    <Directory>
    <DisplayName>#Name#</DisplayName>
    <FullPath>#Name#</FullPath>
    </Directory>
    </cfloop>
    </Test></CFOUTPUT>
    This file generates a query resulting files starting with p*
    and then it should be a file and manipulates in xml.
    development_files_dropdown.xsl pages is as follows.
    <?xml version='1.0'?>
    <xsl:stylesheet version="1.0" xmlns:xsl="
    http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="html" indent="yes"/>
    <xsl:preserve-space elements="*"/>
    <xsl:template match="/">
    <xsl:apply-templates/>
    </xsl:template>
    <xsl:template match="Test">
    <B>Script Name: </B>
    <select name="T1_Dev_Script" CLASS="DevInput">
    <xsl:for-each select="Directory">
    <option>
    <xsl:attribute name="value">
    <xsl:value-of select="FullPath/text()"/>
    </xsl:attribute>
    <xsl:value-of select="DisplayName/text()"/>
    </option>
    </xsl:for-each>
    </select>
    </xsl:template>
    </xsl:stylesheet>
    This is only for the purpose of display .
    Now i want to get one particular file named "pfile" { Code is
    written in development_files.cfm page and kept it in a variable } I
    want to display it in #Name# filed. how can i do that ? I am
    getting XML Parsing error from javascript .
    Could any one look into this .
    Thanks & Regards,
    Nataraj G

    The first part is right -
    1) drag a text element onto the page, at a location in which you want the variable value to be displayed
    2) On the left hand bottom page - go to the web item properties for the text element
    3) scroll down to the specific properties for the item - in that uncheck the first two check boxes - display general text elements & display static filter values
    4) in the next item in the properties (List of text elements) click once on the box where List is written and then clcik on the small browse button that appears.
    5) in the window that opens, in the element type field, select variable/variable value as key (as per your requirement) and then under the element ID field type in the technical name of your variable that you want to display.
    click ok and save your template and try executing it.
    See if this solves your problem.
    regards,
    Nikhil

Maybe you are looking for