Xsl:sort order parameter

Does the oracle xml parser support this syntax (works with Xalan)
<xsl:sort order="{$order}" select="sortnode" />
I need to parameterize the order="ascending/descending". I am sucessfully passing in my parameter (I can output it with <xsl:value-of select="$order"/>), but it doesn't seem to have any effect on the actual sorting.

This is Bug 1798018. It was supposed to be fixed in 9.0.2C, but
I just retested it and the problem still persists.
The order and data-type attributes of <xsl:sort> don't
behave properly as Attribute Value Templates.

Similar Messages

  • Xsl:sort order attribute value template

    I am trying the use the following in XDB 10.1.0.2
    <xsl:sort order="{$myOrder} ...
    It appears that the order attribute does not allow an attribute value template.
    Any suggestions would be appreciated.
    Anthony

    This is known bug 1798018 in the Oracle XSLT processor.
    The only workaround I can think of is to use <xsl:choose> to optionally use different <xsl:for-each> blocks, one with order="ascending" and one with order="descending" as literal values.

  • Group by sort order and display accordingly

    I have two groups - primary sort order and a secondary sort order in my report, formula for both follows:
    If {?Sort Order}='1' then {PRODUCT_CUSTOMER_MNT_V.CUSTOMER_NAME}
    else if {?Sort Order}='2' then {PRODUCT_CUSTOMER_MNT_V.PRODUCT_ID}
    else if {?Sort Order}='3' then {PRODUCT_CUSTOMER_MNT_V.CUST_REVISION_LEVEL}
    else if {?Sort Order}='4' then {PRODUCT_CUSTOMER_MNT_V.CMS_UD36}
    else if {?Sort Order}='5' then {PRODUCT_CUSTOMER_MNT_V.CMS_UD38}
    else if {?Sort Order}='6' then totext(year({PRODUCT_CUSTOMER_MNT_V.PURCHASE_DATE}),0,"")"/"
    right("0" + totext(month({PRODUCT_CUSTOMER_MNT_V.PURCHASE_DATE}),0,""),2)"/"
    right("0" + totext(day({PRODUCT_CUSTOMER_MNT_V.PURCHASE_DATE}),0,""),2)
    Groups are suppressed and fields are placed in the detail the line.  I have a request to group by Customer name with selected product ID's listed or vice versa.   My quandry is how do I accomodate the descriptive fields in the page header since the user can select any number of combinations using the sort order parameter.  Sure, right now they are only looking at customer and product ID but let's face it, that requirement could change in the future.  Seems simple enough but it's been awhile since I've touched reports and my brain is fuzzy.  Is what I'm trying to do possible?   Crystal XI (11.0.0.1282)

    I was overthinking the problem.  The report was already sorting on customer or product based on user selection.  I placed the customer ID/Name field and the Product ID field into group one and checked the underlay following section box in section expert.  This is will work fine for our purposes.

  • Xsl:sort not sorting

    I tried the example of John Butler.
    Source:
    <?xml version="1.0" encoding="US-ASCII"?><SortTest>
    <SortKey>Allergens</SortKey> <SortKey>Muscle, Skeletal</SortKey> <SortKey>Food Handling</SortKey> <SortKey>Muscle Contraction</SortKey> <SortKey>allergen Blo t 5</SortKey> <SortKey>Food</SortKey> <SortKey>Food Hypersensitivity</SortKey> <SortKey>Muscle</SortKey>
    </SortTest>
    and XSL:
    <?xml version="1.0" encoding="US-ASCII"?><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" default-space="strip"> <xsl:output indent="no" /> <xsl:template match="/"> <xsl:apply-templates select="*"/> </xsl:template>
    <xsl:template match="SortTest"> <xsl:element name="{name(.)}"> <xsl:apply-templates select="SortKey"> <xsl:sort order="ascending" data-type="text" case-order="upper-first" select="."/> </xsl:apply-templates>
    <xsl:text>
    </xsl:text>
    </xsl:element> </xsl:template>
    <xsl:template match="SortKey"> <xsl:text>
    </xsl:text>
    <xsl:copy-of select="."/> </xsl:template></xsl:stylesheet>
    and get the (unsorted!) output
    <SortTest>
    <SortKey>Allergens</SortKey>
    <SortKey>Muscle, Skeletal</SortKey>
    <SortKey>Food Handling</SortKey>
    <SortKey>Muscle Contraction</SortKey>
    <SortKey>allergen Blo t 5</SortKey>
    <SortKey>Food</SortKey>
    <SortKey>Food Hypersensitivity</SortKey>
    <SortKey>Muscle</SortKey>
    </SortTest>
    How do I get XSL:SORT to work?

    Here is my results
    D:\src\XMLMAP~1>type testsort2.xml
    <stuff>
    <item>boot</item>
    <item>apple</item>
    </stuff>
    D:\src\XMLMAP~1>type testsort2.xsl
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:template match="/">
    <xsl:apply-templates select="stuff/item">
    <xsl:sort select="."/>
    </xsl:apply-templates>
    </xsl:template>
    <xsl:template match="item">
    <xsl:value-of select="."/>
    <xsl:if test="position() != last()">,</xsl:if>
    </xsl:template>
    </xsl:stylesheet>
    D:\src\XMLMAP~1>..\oraclexml\bin\xslsample testsort2.xml testsort2.xsl
    XSL processor sample
    Parsing XML file testsort2.xml
    Parsing Stylesheet testsort2.xsl
    Initializing the result context
    XSL Processing
    <root>bootapple</root>
    D:\src\XMLMAP~1>

  • Xsl:sort attribute value templates for select and order

    I've tried the xdk_java_9_0_1_0_0.tar.gz update today and for that the reported bugs are still there : one urgent (quite a stopper for us) is this one
    <xsl:template match="/resultlist">
    <xsl:variable name="sortorder">descending</xsl:variable>
    <xsl:variable name="sortfield">name</xsl:variable>
    <xsl:for-each select="result">
    <xsl:sort select="./{$sortfield}" order="{$sortorder}"/>
    <xsl:value-of select="./index"/>,<xsl:value-of select="./name"/>
    </xsl:for-each>
    </xsl:template>
    still it does not replace {$sortfield} and {$sortorder}.

    This is known bug 1798018 in the Oracle XSLT processor.
    The only workaround I can think of is to use <xsl:choose> to optionally use different <xsl:for-each> blocks, one with order="ascending" and one with order="descending" as literal values.

  • Change the sort order (ascending/descending) based on parameter field

    I have created a formula on a subreport to change sorting based on variables.
    select {?Pm-@Sorting}
    case "property_type_desc ASC" :
    {owned_property.property_type_desc}
    case "property_type_desc DESC" :
    {owned_property.property_type_desc}
    default:
    ({owned_property.property_type_cd}; )
    how can I change the sort order ascending and descending using the formula??
    Thanks, Jessica

    Try this
    1. Create a parameter with 2 default values in the picklist: Descending and Ascending.
    NOTE:
    In Crystal Reports version 5 or 6, it is not possible to have a pick a parameter value from a list. The user must enter a specific value, guided by the prompting text. For example : To Sort in Ascending order type A, to sort in Descending order type D.
    u2022 On the 'Insert' menu, click 'Parameter', then click 'New'.
    u2022 Type the name and prompting text for the parameter in the corresponding boxes.
    u2022 In the 'Type' box, click 'String'.
    u2022 Click 'Set Default'.
    u2022 In the 'Value to add' box, type 'Descending' then click '>' to move it to the 'Default Values' list.
    u2022 Repeat the above step for 'Ascending'.
    u2022 Click 'OK', then click 'OK' again to return to the report.
    2. Create 2 formulas based on the field you want to change the sort direction on:
    u2022 On the 'Insert' menu, click 'Formula', then click 'New'.
    u2022 Create this formula:
    @Asc
    If {?Parameter} = "Ascending" then
    u2022 Save this formula and close the Formula Editor. This brings you back to the Formula tab of the Insert Fields dialog box.
    u2022 Click 'New' and create this formula:
    @Des
    If {?Parameter} = "Descending" then
    u2022 Save this formula and close the Formula Editor.
    u2022 Click 'Close' to return to the report.
    4. Sort the report based on these two formulas.
    u2022 On the 'Report' menu, click 'Sort Records'.
    u2022 In the 'Report Fields' list, click {@Asc} and move it to the 'Sort Fields' list.
    u2022 Under 'Sort Direction', click 'Ascending'.
    u2022 In the 'Report Fields' list, click {@Des} and move it to the 'Sort Fields' list.
    u2022 Under 'Sort Direction', click 'Descending'.
    u2022 Click 'OK' to return to the report.
    Once you preview the report you will be prompted to select a parameter value, which will determine how the report is sorted.
    Regards,
    Raghavendra

  • Defining sort order using parameter fields

    Post Author: vandersee
    CA Forum: General
    I've created a report, the contents of which is sorted depending on a parameter selected (method used is as described in the help topic entitled "Defining sort order using parameter fields".  Is it possible to vary the Sort Direction (ascending/descending) using parameters also, so that if I choose to sort by field A it will be ascending, but descending if I choose to sort by field B?

    Post Author: V361
    CA Forum: General
    You can create a Parameter {?Sort Order}  make it a string, and add items A to Z and Z to A and a formula and sort the group using the formula.
    Group Expert, select the group, select options, check use a formula as group sort order
    if {?Sort Order} = "A to Z" then crAscendingOrder else crDescendingOrder
    And your group will sort based on what is selected in the parameter.

  • MDO select query: how to control sort order using parameter

    Hi experts, is there a way of controling the sort order of an MDO select query using some parameter?
    I was thinking about using some statement like CASE [Param.1] WHEN 'abc' THEN [ORDER_NO]...END in sort section of the query but it is not working.
    Of course I colud go for various select queries...but I am wondering if it can be done using only one?
    Any ideas?
    Thanks for any help

    Hi Marco,
    Yes this can be achieved dynamically using SortExpr under dynamic link assignment in MDOAction block if you are using a transaction to call it.
    Please check below thread:
    Re: MDO Query Action Block In MII Transaction
    Or else, this [Param.1] thing should work as well provided it doesn't get the logic part in it, just pass the columns names separated by comma. Haven't tried it though, will check it for you.
    Best Regards,
    Swaroop

  • BPC 7.5NW: Hierarchy Upload from BW - Sort Order

    Hi,
    we are currently updating from BPC 7.0NW to 7.5 NW SP10. (BW has been upgraded to 7.02 SP09)
    As master data and hierarchies had been uploaded using the coding from 'HowTo Upload automated...' so far, we now have to use standard Data Manger packages.
    Maintaining packages and package links was successful. Everything works fine so far.
    The only problem are Hierarchies, better the sort order of hierarchie nodes. At the moment they are always sorted in an alphabetical order.
    We introduced property MBR_SEQ to all dimension using program UJA_MIGRATE_MBR_SEQ.
    We loaded hierarchies with different settings.
    Searching SDN and SAP Notes lead to notes 1603352 or 1581331.
    But manually changing hierarchies each time, new members are assigned, is not an option!
    Do I miss any option in the selection screen of the Data Manager package?
    Are there any options in transformation or conversion file?
    Thanks and regards
    Steve

    For your Information...
    We were now adviced to include parameter DM_KEEP_SRC_SEQ with value Y in AppSet parameters (Web-Administration).
    Please have a look at note '1626929 - Keep hierarchy sequence for Load Hierarchy from BW package'.
    It works!
    For the first hierarchy to be uploaded...
    If there are more than one hierarchy defined for upload, only the first hierarchy is sorted correctly, all following ones are sorted alphabetically again.
    Regards
    Steve

  • Sort order in Java application (oc4j container) -- ear file deployment

    I have a Java application deploy in Oracle OC4J container (EAR file).
    In my Java application (jsp), I have a SQL statement who return data but the
    sort order is wrong. The letters "é" and all characters with accents
    appears at the end of the result.
    I tried many things to change the sort order (NLS parameters in database
    and OAS10g parameter files).
    When I use SQL*plus on database server, that's working.
    The sort order is wrong when I use the java application.
    Somebody can tell me what and where is the NLS parameters to change ?
    Thanks
    Robin

    Robin,
    I'm only guessing, but it could either be related to the java locale or the CHARSET attribute of the HTML header -- and nothing to do with the NLS parameters.
    Maybe you should try the Globalization Support forum?
    Good Luck,
    Avi.

  • Sort order in Java Application (deploy in Oracle oc4j container)

    I have a Java application deploy in Oracle OC4J container (EAR file).
    In my Java application (jsp), I have a SQL statement who return data but the
    sort order is wrong. The letters "é" and all characters with accents
    appears at the end of the result.
    I tried many things to change the sort order (NLS parameters in database
    and OAS10g parameter files).
    When I use SQL*plus on database server, that's working.
    The sort order is wrong when I use the java application.
    Somebody can tell me what and where is the NLS parameters to change ?
    Thanks
    Robin

    Robin,
    I'm only guessing, but it could either be related to the java locale or the CHARSET attribute of the HTML header -- and nothing to do with the NLS parameters.
    Maybe you should try the Globalization Support forum?
    Good Luck,
    Avi.

  • Custom Sort Order in Dropdown list of translate values

    Peoplesoft sorts the dropdown translate values in ascending order by default. I wanted to change the sort order. For example:
    The translate values in alphabetic order are:
    Andrea
    Baluch
    Others
    Shumi
    I want this "Others" as the last value. So the drop down should display like this:
    Andrea
    Baluch
    Shumi
    Others

    From a document I had created ...
    This odd behavior of PeopleTools however can be overridden by implementing a few lines of JavaScript and PeopleCode.
    The approach is quite simple and summarized briefly as below:
    1.     Concatenate the value-description pairs of the dropdown list into a single string separated by a pipe “|” as delimiter (in case other delimiter is used the script shown below in Step 4 has
    to be accordingly modified) in the sequence in which it should be displayed on the page.
    2.     While concatenating, make sure to place the value first and then the description, these being separated by the delimiter. Example: “01|”|”January”|”02|”February” …and so on.
    3.     Pass this string as a parameter to an HTML definition through a GetHtmlText function. This HTML definition in turn will a have a JavaScript logic to resolve this delimited string into
    meaningful value-description pairs and use them to override the intended dropdown list.
    Below are the steps in detail:
    Step 1:
    Find out the html element-id for the dropdown field from the html source-code of the PeopleSoft page from the browser. In HTML, the tag for a dropdown field is <select> </select>
    The element-id is set by the id attribute of the <select> tag. This id would be used in Step 5.
    Step 2:
    Add a field of type Long Character to any work record that you may be using on your page for buttons, hyperlinks, etc.
    Step 3:
    Add an HTML-Area to the page (preferably alongside the dropdown field which needs need to be sorted). In the properties of the HTML-Area, assign the Record-field used in Step 2 above.
    Step 4:
    Create a HTML definition from the app-designer and add the below JavaScript code to it and save the definition.
    <script>
    var j=0;
    var str=new String('%bind(:2)');
    ar1=str.split("|");
    var fld = document.getElementById("%bind(:1)");
    fld.options.length = 0;
    fld.options[fld.options.length] = new Option('', '');
    while (j<ar1.length)
              fld.options[fld.options.length] = new Option(ar1[j+1], ar1[j]);                      
                    j=j+2;
    </script>
    Step 5:
    Write peoplecode on an appropriate event to generate the concatenated string of value-descriptions delimited by a pipe “|”. A pseudocode for the same is shown below. Here the HTML id for the dropdown field and the value-description string are passed as parameters to the JavaScript shown in Step 4; and JavaScript thus created after substitution of the Bind values is assigned to the value of Record.Field used in Step 2 & 3. The location of the below peoplecode may vary depending on the when the dropdown list needs to be sorted.
    Local string &strDropdownValues;
    &strDropdownValues = "1|" | "January|" | "2|" | "February|" | "3|" | "March|" | "4|" | "April|" | "5|" | "May|" | "6|" | "June";
    <Record.Field>.Value = GetHTMLText(<HTML.DPS_DROPDOWN_HTML>, "<DROPDOWN_ID>", &strDropdownValues);

  • Sort order help for date string in crosstab

    Hello All,
    I need to calculate the number of calls for service for the last 13 months. Display the number in the report footer by month and year in a grid similar to a crosstab and in ascending date sort order. 
    Example: 
    May 2008    1,400
    Jun 2008     1,287
    Jul 2008      1,290
    all months through last full month 
    May 2009    1,385
    I can calculate the number of calls per month and display the month and year by converting the month and year to text.  However, I cannot seem to find a way to sort the month and year without some kind of on-going manual intervention.  I need to make the report maintenance free for monthly scheduled e-mail distribution in business objects enterprise.  Specified order does not work since the column headers will change each month.  It needs a sort order formula, but I am not sure how can this be done inside a cross tab? 
    Any help or suggestions are appreciated!
    Thanks,
    Wendy Douglass

    Hi,
    I have a similar cross tab in my report. but only problem is grouping is done based on a parameter GroupBy, which has Day, Week, Month values.
    if user selects day or week, cross tab should display column in dd/mm/yy format, if its month, MMM-yy format.
    I have created a date formula ,  GroupBy = Day then Opendate
                                                       GroupBy = Week then opendate -dayofweek(opendate)+1
                                                       GroupBy = date(year(opendate),month(opendate),1)
    and used this date formula as column in cross tab. I tried to format using custom date style...but its not working in cross tab.
    if I use totext to format the date formula, data will not be in sorted order...ex, its showing jul-99 before jun-99
    can anyone help?
    Thanks in Advance,
    Jyothi
    Edited by: Jyothi Yepuri on Jul 8, 2009 5:27 AM
    Edited by: Jyothi Yepuri on Jul 8, 2009 6:10 AM

  • Functions in xsl:sort

    Is it possible to use extension functions in the select attribute of xsl:sort? This way I could sort the nodes based on a computed value.
    e.g. <xsl:sort select="myns:myextfunc(ELEM1, ELEM2)">
    I tried using a standard XSL function like
    <xsl:sort select="concat(ELEM1, ELEM2)"/> and it seems to work but when I try to use an extension function it fails.
    TIA
    null

    With XML Parser 9.0.1 Production, this works for me:
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:ext="http://www.oracle.com/XSL/Transform/java/Ext">
    <xsl:output method="text"/>
    <xsl:template match="/">
    <xsl:for-each select="/Employees/Emp">
    <!--
    | Due to a bug, need to declare the extension namespace on
    | the <xsl:sort> element itself.
    +-->
    <xsl:sort data-type="number" order="descending" select="ext:max(Salary,Bonus)"
    xmlns:ext="http://www.oracle.com/XSL/Transform/java/Ext"/>
    <xsl:value-of select="Name"/>
    </xsl:for-each>
    </xsl:template>
    </xsl:stylesheet>
    public class Ext
    public static double max( double n, double m ) {
    return n > m ? n : m;
    <Employees>
    <Emp>
    <Name>B</Name>
    <Salary>10</Salary>
    <Bonus>12</Bonus>
    </Emp>
    <Emp>
    <Name>C</Name>
    <Salary>25</Salary>
    <Bonus>12</Bonus>
    </Emp>
    <Emp>
    <Name>A</Name>
    <Salary>10</Salary>
    <Bonus>2</Bonus>
    </Emp>
    </Employees>If I make sure Ext.class is in my CLASSPATH, and transform the above XML by the above stylesheet, I get:
    CBA
    which is the reverse-numerically-sorted list of max() calculations.

  • Change sort order in line graph

    Sorry, my mistake !
    In one of the ColLabels i had placed the xsl:sort line ABOVE the xsl:for-each.
    So, now it is working.
    In a line graph I need to change the sort order of the elements in my XML file.
    I need the elements to be sorted by month number, so that january comes first, then february etc.
    I have an element in the XML file called DATE which has the format 'YYYYMMDD'
    I tried first to change the sort command for the Label.
    <ColLabels>
    <xsl:for-each select=".//XX_ROW" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:sort select="substring(DATE,5,2)"/>
    That worked fine, the label values are resorted as I wanted.
    Of course, I also have to set the same sort order for the data values.
    So I did that in the same way :
    <RowData>
    <xsl:for-each select=".//XX_ROW" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:sort select="substring(DATE,5,2)"/>
    But, to my surprise, I got an error :
    Caused by: oracle.xdo.parser.v2.XSLException: <Line 70, Column 45>:
    XML-22047: (Error) Invalid instantiation of 'xsl:sort' in 'RowData' context.
    Does anybody understand why this was not possible ?
    Is there another syntax for sorting in the RowData ?
    What's the use of being able to sort the X axis lable, if I am not able to sort the data ?
    Edited by: user792912 on 2011-maj-30 05:11

    This was an error I had made in the graph code.
    The xsl:sort line must be placed AFTER the xsl:for-each !

Maybe you are looking for

  • RSM_INFOCUBE_WRITE_CHECK

    Hi All,      There was an issue(Short dump), it might be due to the program error, during the rebuild or persistent staging area (PSA) process of a request from the PSA to an InfoCube, a dump occurs with MESSAGE_TYPE_X in "SAPLRSMDATASTATE" in the in

  • Hyperlinks created in CS6 introduce extra characters

    I've noticed that when I create hyperlinks in InDesign CS6 (v 8.0.1) it adds extra characters in the URL, thus breaking the link. For example [red highlights problem areas]... Correct hyperlink typed into InDesign: http://portfolio.epri.com/ProgramTa

  • PDF toolbar disabled on some sites in IE8 (Acrobat v8.1.3)

    Hello, Recently we have come across sites that do not allow a conversion to PDF through the Adobe PDF toolbar in IE8. The toolbar is greyed out. For example, when searching google.com for acrobat, the results page has a greyed out pdf toolbar. Has an

  • Phone says no service after having it activated

    Please help me...... Bought no iPhone called to have activated and it won't call out or in as it says no service, telus tried to help me reboot it and do different things they now say it is a hardware problem? Anyone else have this issue?

  • Network Settings Disappearing

    I keep loosing my internet connection since doing the upgrade earlier this week and I have come to my own conclusions on what's going on. I believe that the update helped create a leak in memory, since if I can connect to the internet for three to fo