Xsl:param question

hi in my xsl
I have something that is like
<xsl:param name="x" select="@somevalue"/>
that @somevalue is suppose to have a value assigned to it (so it is dynamic).......but I can't figure out how it might work
can someone provide my some info as to how @ this works in the xsl world....
basically I want to know how i can assign value to that @somevalue...
jaxb...?!
thanks

Are you asking what the @ character means? It's a shortcut for the attribute axis, so basically "@somevalue" means "the somevalue attribute of the context node".

Similar Messages

  • Can we use xsl:param element in XSLT mapping...?

    Hi Guys
    Can we use <xsl:param> element in XSLT mapping in XI..?
    Is there any documentation out there for XSLT mapping?
    Thanking in advance

    Hi,
    Check this link for an example:
    https://www.sdn.sap.com/sdn/url.sdn?res=/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/6c514a4f-0501-0010-038c-994da5200215
    Regards,
    Sridhar

  • Help: on using xsl:param

    I am working on some xsl codes to do transformation,
    I have some codes like this:
    <xsl:template match="mytemplate">
    <xsl:param name="myparam"><xsl:number value="count()"/></xsl:param>
    function myfunction_{$cid} ()
    <!--I want the function name shows as "function myfunction_5 ", (5 is return value of count()).-->
    </xsl:template>
    Any help is greatly appreciated!

    Why would you use <xsl:param> to do that? Try this instead:
    function myfunction_<xsl:number value="count()"/> ()
    Or if you saw an example of an attribute value template somewhere else and tried to use it without understanding it, how about this:
    <xsl:variable name="cid"><xsl:number value="count()"/></xsl:variable>
    function myfunction_{$cid} ()
    Finally, what does this have to do with Java? There are plenty of active XSL mail lists where you would be much more likely to get a useful answer.

  • XMLTansform and xsl:param values

    Hello,
    I would like to know if it is possible to pass xsl:param values when calling XMLTransform(xml, xsl).
    If not, is there another way to render an XML with an XSL that takes parameters?
    Thank you.

    RDC has been deprecated since version 9 meaning no new functionality has been added to it. Cascading Parameters were added in CR 11.
    There is no set of API's to access these types of Parameters at this time.

  • XSL param filter for character length?

    Hi I am using a xsl a transformation and using a param filter to only show 4 items (Works great!) but I would only like to show the first 50 Characters of the Article... is there a param filter I could pass to do this? or Would I need to make a new XML node to show?
    Thanks for any help!
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="html" encoding="UTF-8"/>
    <xsl:param name="ItemsPerPage" select="4" />
    <xsl:template match="/">
    <xsl:for-each select="dataroot/item[position() &lt;= $ItemsPerPage]">
    <xsl:sort select="date" order="descending"/>
      <h3><xsl:value-of select="title" disable-output-escaping="yes"/>
        </h3>
       <h5><xsl:value-of select="location"/> :
      <xsl:value-of select="date"/></h5>
       <h5><xsl:value-of select="author"/></h5>
        <xsl:value-of select="article" disable-output-escaping="yes"/>
          <xsl:value-of select="image"/>
           <xsl:value-of select="link"/>
    <br class="clearfloat" />
    </xsl:for-each>
    </xsl:template>
    </xsl:stylesheet>
    IsleA-Row2_Seat7

    Try this:
    <xsl:value-of select="substring(article, 1, 50)" disable-output-escaping="yes"/>
    AFAIK, that will cut it off at 50 characters. An alternative that might be more elegant is to select the first sentence and add an ellipsis like this:
    <xsl:value-of select="substring-before(article, '. ')" disable-output-escaping="yes"/>
    <xsl:text>... </xsl:text>

  • Xsl:param

    I run XSL-script from Java-servlet using XML parser v.2.0.2.9.
    I want to pass the node list to stylesheet script. How can i do it?? For example:
    XML -------------
    <root>
    <leaf>1</leaf>
    </root>
    XSL -------------
    <xsl:param name='new_leaves'/>
    <xsl:template match='leaf'>
    <xsl:copy-of select="$new_leaves"/>
    </xsl:template>
    When servlet runs XSL-script it passes parameter by setParam(...).
    The result XML-file must be something like:
    Result XML ------
    <root>
    <leaf>2</leaf>
    <leaf>3</leaf>
    </root>
    When parameter is literal value then all right. The problem rises when i want to pass the node list for a parameter.
    Thanks

    Cannot be done directly to the best of my knowledge.
    You could pass a value which is a space-separated list of numbers, then write an XSLT recursive template to parse the space-separated list of numbers and turn it into the XML fragment you're trying to create.

  • XSL attribute question

    *<xsl:attribute name="xdofo:rowspancell-repeat-nextpage" xdofo:ctx="block">true</xsl:attribute>*
    Hello, can you provide me some example on how to use this code? i tried putting this code in a field in a table however it doesn't do any changes in my report, the header still don't repeat.
    i'm aware of the word functionality to repeat a header, but due to the structure of my table, that method will changes the output of my report. the reason is i have a looping condition in that header, so if i tried to repeat it, the looping also repeats.
    to summarize my table outline:
    <HEADER1>---repeating already
    <HEADER2 with looping condition>---> the one that i want to repeat
    both headers belongs to a one table
    i tried separating the header 2 to another table but it destroys my report output
    thanks in advance! :)

    Hi
    You may get help if you post your question on its forum.
    XML DB
    -Priyanka

  • XSQL to XSL params passing problem

    I'm trying to pass some parameters from XSQL to processing XSL, but I am unable to pass string constants. To make it clear:
    XSQL:
    <?xml version="1.0" ?>
    <?xml-stylesheet type="text/xsl" href="some.xsl" ?>
    <qry xmlns:xsql="urn:oracle-xsql" connection="orcl8">
    <xsql:set-stylesheet-param name="from" value="{@f}" />
    <xsql:set-stylesheet-param name="where" value="{@w}" />
    <xsql:set-stylesheet-param name="orderby" value="{@o}" />
    <xsql:query max-rows="{@mr}" skip-rows="{@sr}" null-indicator="yes">
    <![CDATA[
    select * from {@f} where {@w} order by {@o}
    ]]>
    </xsql:query>
    </qry>
    XSL (most of code omitted to save space):
    SELECT * FROM <xsl:value-of select="$from"/>
    WHERE <xsl:value-of select="$where"/>
    ORDER BY <xsl:value-of select="$orderby"/>
    If I pass w=FIELD='some string' (and even when I use &apos; ) all parameters passed to the XSL come empty. Everything without apostrophes comes in just fine, but appearance of apostrophes or their escaped equivalents causes all parameters to get in empty. Query is executed correctly though.
    Am I doing something wrong or there's a bug in XSQL processor (or maybe what I'm trying to do is simply impossible - I just started to learn XML/XSLT and not sure I'm getting everything right...)?
    regards,
    Bob.
    null

    In my xsql I run various SQL statements. Some of these select configuration type details for that user/session. So the returned XML includes business data and some configuration data.
    My main XSL uses these values to determine which templates to process. I use xsl:choose.
    It does mean a big choose statement but it works fine.
    Matt

  • Xsl:param or xsl:variable gets reset.

    Hi, I'm trying to keep a counter using a top level variable in xsl.
    <?xml version="1.0"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:variable name="rownumber">1</xsl:variable>
    And every time my xsl calls a specific template, i want to keep a counter.
    <xsl:template match="row">
    <xsl:variable name="rownumber">     
    <xsl:number value="$rownumber+1"/>     
    </xsl:variable>     
    <xsl:variable value="$rownumber"/>
    </xsl:template>
    However, my variable $rownumber always gets reset to the default value of "1" everytime the template is called and returns a value of "2".
    Is there a work around for this? Is there a way to keep a counter in xsl? Can top level variable change?
    I don't want to count the nodes either....
    Thanks in advanced,
    jon

    You can't do that. Variables can't change. And there is no "workaround", as you put it. XSLT is not that kind of programming language. If you want to count something, you need to figure out an expression that looks at the incoming XML and determines the answer. This is often surprisingly easy once you stop writing programs that assume that statements are executed one after the other. For example, in your case it appears that you just want to count the number of "row" elements in the document. The XPath expression for that is "count(//row)". Or perhaps you want to count the number of "row" elements below the current node; that's "count(row)".

  • Xsl sum question

    hi all,
    I'm trying to find the sum of a specific set of nodes and my sum statement looks like this:
    <xsl:value-of select="sum(//row[*[name=$sortDefault]/month=$currentMonth]/obligation)"/>
    This will sum up all the obligation nodes of all the rows that have $sortDefault as the name of the node and their month node equal to $currentMonth, however, I need the rows to have their year node equal to $currentYear also, is there any way i can add that criteria into that statement, month and year nodes are siblings, thanks in advance.

    this is what my xml looks like:
    <row>
    <row>
    <r_object_id>0000FE3451024</r_object_id>
    <kex_agreement>service agreement</kex_agreement>
    - <kex_date date="20050407">
    <fulldate>4/7/05 4:03 PM</fulldate>
    <year>2005</year>
    <month>04</month>
    <day>07</day>
    </kex_date>
    <agreement_name>5</agreement_name>
    <obligation>300</obligation>
    </row>

  • OSB 11G xsl/xquery question in Proxy

    OSB 11G
    In Proxy, I have to invoke a business service which has 3 operations
    I need to use response of first 2 operations,as request to third operation along with some input xml to OSB Proxy.
    customer, group, severity are hard coded.(which will be input to OSB)
    How do I add/insert response from op1 after <string>customer</string> ??
    and response from op2 after <string>group</string> . ??
    <InvokecreateRequest_InputVariable>
    <part name="parameters" >
    <createRequest>
    <sid>1959439747</sid> // is resp from operation1, which is request to operations3
    <creatorHandle/>
    *<attrVals>* // this is array of string
    <string>customer</string>
    <string>cnt:08DF89FC07516A41B228587DBE75B6A7</string> //resp from op1, that has to be request to op3
    <string>group</string>
    <string>B79AAF63D870F845980A</string> //input to OSB
    <string>severity</string>
    <string>2</string> //input to OSB
    *</attrVals>*
    <propertyValues>
    <string/>
    </propertyValues>
    <template/>
    <attributes>
    <string>persistent_id</string>
    </attributes>
    </createRequest>
    </part>
    </InvokecreateRequest_InputVariable>
    Also, should I use assign or insert in Proxy ??

    Not sure exactly what you need, but here is a basic layout of what you need to do.
    Make a service callout to the first operation and save the response in a variable, for ex $resOne
    Then make a service callout to the second operation ans save the response in a variable for ex $resTwo.
    Now use a replace or assign action to create the request for the third operation:
    If you are using a Route action on Route node to call the third operation, you should use a replace action and replace the contents of $body with the XML content as needed. If you are going to use another service callout, then you should use an assign to create a request variable.
    In either case, this is what your XQuery should look like:
    <InvokecreateRequest_InputVariable>
    <part name="parameters" >
    <createRequest>
    <sid>{$resOne/ns:ElementName/ns:SID/text()}</sid>     // Here you will populate value from $resOne using a correct XPath
    <creatorHandle/>
    <attrVals>
    <string>customer</string>
    <string>cnt:08DF89FC07516A41B228587DBE75B6A7</string>
    {$resOne}    // here you are inserting the complete response from Operation one
    <string>group</string>
    {{$resTwo}    // here you are inserting the complete response from Operation Two, You can choose to populate these values separately inside variables like for SID above.
    <string>B79AAF63D870F845980A</string>
    <string>severity</string>
    <string>2</string> //input to OSB
    </attrVals>
    <propertyValues>
    <string/>
    </propertyValues>
    <template/>
    <attributes>
    <string>persistent_id</string>
    </attributes>
    </createRequest>
    </part>
    </InvokecreateRequest_InputVariable>

  • XSL transform question from XML date datatype to SQL date datatype

    Just to give an idea, I am reading some employee information in a CSV format and I have created the fileadapter to read it and parse it into coherent information where each comma separated value corresponds to a column in an employee table. One of the columns is of the date object in the database.
    So my my variable is created with a list of employees and then fed into the invoke that calls a dbadapter that does the insert. I am using a transformation to get the values from one variable into the other simply because of namespace conflicts. However the xml date will not match the sql date object as to be expected...but how do I work around it? I have a few ideas but I am not sure they are worth mentioning.
    Any suggestions?

    @@Version : ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Microsoft SQL Server 2012 - 11.0.5058.0 (X64)
        May 14 2014 18:34:29
        Copyright (c) Microsoft Corporation
        Developer Edition (64-bit) on Windows NT 6.2 <X64> (Build 9200: ) (Hypervisor)
    (1 row(s) affected)
    Compatibility level is set to 110 .
    One of the limitation states - XML columns with a depth of more than 128 nested nodes
    How do i verify this ? Thanks .
    Rajkumar Yelugu

  • Question on AIA XSL Extension

    AIA recommends to provide _CUSTOM.XSL along with regular transformation xsl file for customers to add their custom transformation. It says, make a callout to the template in custom.xsl as follows
    <xsl:call-template name="SenderType_ext">
    <xsl:with-param name="currentNode" select="."/>
    </xsl:call-template>
    and in custom xsl, add the code as
    <xsl:template name="SenderType_ext">
    <xsl:param name="currentNode"/>
    <!-- Customers add tranformations here -->
    </xsl:template>
    I did this and tested to see how customers would add their extension. I have no luck.
    My problem is, the param 'currentNode' passed in from the xsl is an xml struture
    like
    <body>
    <szShippingCommodityClass>SH1</szShippingCommodityClass>
    <szBusinessUnit/>
    <szOrderRepriceCategory/>
    <szUserId>KB7479464</szUserId>
    but its treated a string content in custom xsl. How can we parse this and say, we need to retrieve the 'szUserId'? I tried couple of option.
    1. Tried to use orcl:parseEscapedXML, but it gives me an error saying "exception:start of root node expected"
    2. Tried parse it using substring..but it couldn't parse by the tag name..seems ike the string only has values...i could able to substring by say 'KB7479464'...
    So, please give me some guidance on how to parse the parm passed in thorugh <xsl-call template> and retrieve an element?
    Thanks

    Hi,
    Could you please provide detailed error message along with environment details. Which version of AIA and SOA are you using.
    Thanks
    Rohit

  • Xsl question - call xsl from another xsl

    Hi,
    I have a xsl which should be invoked from another xsl. I have a transformheader.xsl which transforms the header values. I would like to invoke this xsl from various client xsl files.(to transform the header).
    transformheader.xsl should take the header as input and give header as output.
    Basically I am moving the header transform logic to one xsl file & reuse it.
    Can you please help me with the syntax or any links to samples/docs?
    transformheader.xsl:
    <?xml version="1.0" encoding="UTF-8" ?>
    <xsl:stylesheet version="1.0">
    <xsl:template match="/">
    <ns1:header>
    <ns1:ebmAID>
    <xsl:value-of select="/ns1:header/ns1:ebmBID"/>
    </ns1:ebmAID>
    <ns1:ebmBID>
    <xsl:value-of select="/ns1:header/ns1:ebmAID"/>
    </ns1:ebmBID>
    </ns1:header>
    </xsl:template>
    </xsl:stylesheet>
    client1.xsl(transforms one message to other, both has the header)
    <?xml version="1.0" encoding="UTF-8" ?>
    <?oracle-xsl-mapper......>
    <xsl:stylesheet version="1.0">
    <xsl:template match="/">
    <tns:sampleee>
    <hdr:header>
    ===== invoke the transformheader.xsl to insert the header here
    </hdr:header>
    <tns:body>
    <xsl:for-each select="xxxxx">
    </tns:body>
    </tns:sampleee>
    </xsl:template>
    </xsl:stylesheet>

    Here you go:
    CreateHeader.xsl
    <xsl:stylesheet version="1.0"
         xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
         xmlns:inp="http://temp.org/input"
            xmlns:out="http://temp.org/output"       
                    >
         <xsl:template name="CreateHeader">
                 <xsl:param name="InputHeader"/>
                   <out:header>
                        <out:ebmAID>
                             <xsl:value-of select="/inp:header/inp:ebmID"/>
                        </out:ebmAID>
                        <out:ebmBID>
                             <xsl:value-of select="/inp:header/inp:ebmContextID"/>
                        </out:ebmBID>
                   </out:header>
         </xsl:template>
    </xsl:stylesheet>Main XSL:
    <xsl:stylesheet version="1.0"
         xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
         xmlns:inp="http://temp.org/input"
            xmlns:out="http://temp.org/output"       
                    >
         <!-- Import the createHeader.xsl here -->
         <xsl:import href="CreateHeader.xsl"/>
         <xsl:template match="/">
              <out:RootElement>
                   <!-- This will inser the header by calling the CreateHeader XSL -->
                   <xsl:call-template name="CreateHeader">
                        <xsl:with-param name="InputHeader" select="inp:header"/>
                   </xsl:call-template>
                   <xsl:for-each select="/inp:body">
                        <out:body>
                             <!-- logic for creating body goes here -->
                        </out:body>
                   </xsl:for-each>
              </out:RootElement>
         </xsl:template>
    </xsl:stylesheet>

  • Omniportlet XML : Param to XSL Filter

    Hi,
    I have an xml file not in the <rowset><row></row></rowset> format to display in an XML Omniportlet.
    I have made a XSL file to transform it.
    My portal is in three languages.
    I have added a param (<xsl:param name="lang">) to my XSL file.
    How can I pass the NLS_LANG to that XSL file ?
    I tryed to add a system parameter on the page to the omniportlet containing the NLS_LANGUAGE but it doesn't seems to work.
    I tryed to set the XSL URL to : url/file.xsl?lang=##Param1##
    How to do it ?
    Thank you for your help.
    Benoit Pironet
    Message was edited by:
    Benoit.Pironet

    Hello, I have a problem with the same omniPortlet. I have to show data from an xml file exported with excel and I can´t build the filter.xsl correctely... always I get some error.... like
    *"Target XML document does not conform to a rowset-row structure."* or
    *"Failed to load user defined filter"*
    Could anybody Help me??
    Could anybody send me an example, an xml file (exported with Excel) with its xsl file that works?? PLEASE???

Maybe you are looking for

  • NetBeans MobilityPack 5 BUG?? how can I send a byte array?

    I�ve created a WebApp and a Simple servlet with one public method. public byte[] getStr(byte[] b) {        String s = "A string"; return s.getBytes(); Then I've used "Mobile To Web App" wizard to generate stubs to that getStr method. And when I�ve tr

  • ITunes 12.0.1.26 update will not connect to internet, despite no connection problem on my PC?

    After upgrading to 12.0.1.26, podcasts won't update and cannot access iTunes Store. Get a message that I cannot access as not connected to internet. There is no problem with my connection. I've rebooted, delete & reloaded etc., still not working. Not

  • How do i control my object effects when i use a button?

    I want to use a button so when I click on it a square rises up from the bottom of my slide.  What I'm finding is by the time I click the button to make the square visible its effect has already loaded with the slide so you don't get to see the square

  • Attachments -- why can I drag them off on one computer but not another??...

    Hello -- I have two different Mac Pro's, an iBook and a Snow iMac. (Everything running OS X 10.5.7 except the iMac is 10.3.9.) On most of the computers, when I look at an email in Mail that has an mp3 attachment, I can just click-and-drag it right on

  • CP2025 printer - stripes across page

    Hi, I have a HP Laserjet CP2025 printer that I've used for 1 year. I'm connecting via network and am running XP. Every once in a while, my pages will print out with black, yellow, cyan, magenta stripes that run horizontally across the page. This happ