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.

Similar Messages

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

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

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

  • Sort Order Driven By Other Field In PowerView on a Relational Source

    Hi,
    Is there a way to sort an attribute in a chart by a different attribute that is not shown in the chart on a relational source (as e.g. possible with a PowerPivot table source where you can specify to use a different field as sort order)? I achieve the desired
    result as per below:
    but I of course don't want to show the sort order attribute in the chart.
    Thanks for your help!
    Martin

    Hi Martin,
    Do you mean you want to sort the chart by a attribute that not shown in the chart and not in the datasource, right?
    Could you please descript the requirements more clearly.
    Swallow

  • Sort Order as per HFM Hierarchy

    Hi,
    I am in a situation, where I need to generate/export a hierarchy from DRM, ensuring members are in the exact order as they are in the upstream HFM application.
    Is there a way to generate a sort order, or assign the sort order property values of members after loading them to the hierarchy.
    Meaning, I want to manually change the order of the members in the hierarchy, and then have the sort order property take values based on the order of the member in the hierarchy.
    Can anyone tell me how i can achieve this, or even create a derived sort order property which can employ such a logic?
    Thanks in Advance.
    Regards,
    Anindyo

    Go to hierarchy properties for which you want node to have sort order.
    give the property value for StandardHierSort as SortOrder.
    Now run the automator to change the property SortOrder for each nodes.
    You can set value as 1 for nodes you want first in extract then 2,3, so on.
    Instead of running automator for each node, you can also create a derived property of type sort and use that in hier level property
    Hope this helps
    Thanks

  • Crystal reports graph sort order

    I have 2 fields called fiscal year and fiscal month.
    Expected sort order - sample values:
    Fiscal year     Fiscal Month
    2011     5
    2011     5
    2011     6
    2011     7
    2011     8
    2011     9
    2011     10
    2011     11
    2011     12
    2012     1
    2012     2
    2012     3
    2012     4
    2012     5
    2012     5
    Current sort order- shows up incorrectly by default
    Fiscal Year  Fiscal Month
    2011          10
    2011          5
    2011          6
    2012         12
    I will be using these values in a graph and I created a new formula column called time PEriod that I will be in the
    x axis of my graph (mid({query.fiscal_mth_nbr1},1,3)) . the output of this formula is Oct,Nov, Dec,Jan,....Oct
    Without the year, but it still needs to be sorted in the first sample values order , since fiscal year starts in Jun and ends
    in July. We are now in fiscal year 2012 , fiscal month 6
    I tried sorting the value inside crystal reports by going to design view and applying sort. But it does not take the
    sort order. Can you please suggest the best way to keep the sort order. The data is coming from a universe and I even tried
    to sort the data from the universe by using order by, but the database would not let me use order by  that in a derived table within the universe.
    Edited by: developerbo1 on Nov 14, 2011 7:19 PM

    hello,
    the best way to get the correct dynamic sort is by using a two digit month in your conversion. for example
    totext({table.datefield}, 'yyyyMM')

  • Add_item : Attributes list collection sort order

    Hello:
    I created multiple custom attributes and added them to my custom item type. I need to apply these attributes while adding an item programmatically.
    1) How do i define the order of the Attributes list via the Portal builder so as to match the corresponding values read from a list/table,etc. ?
    2) The ordering arrow buttons in the attribute list of my custom item type does not match the result set from my query. I tried all options of "order by" clause. Here is the query - (componenttype is the name of my custom item type)
    select iatts.ID
    ,atts.caid
         ,atts.DATA_TYPE     
         ,atts.CAID
         ,atts.NAME,atts.DISPLAY_NAME
         ,iatts.ITEM_TYPE_ID
    from wwsbr_item_types itypes
    ,wwsbr_item_type_attributes iatts
    ,wwsbr_attributes atts
    where --itypes.caid = 133
    itypes.name like 'ComponentType'
    and itypes.ID = iatts.ITEM_TYPE_ID
    and iatts.ATTRIBUTE_ID = atts.ID
    --and atts.CAID = 133
    order by atts.id
    3) I need to expect a certain order of the attribute ids, when bulk collecting into the attributes array, in order to populate the values collection in the same. So, how do I determine the order of the attributes ids ?
    4) Is there a better way to do this ?
    Thank You.
    regards
    Ananth

    Document Sets are great tools for grouping multiple documents together. However, if every set has exactly one document, it would be better to just upload the file and not place it within a Document Set:
    Uploading documents using object model - http://msdn.microsoft.com/en-us/library/office/ms454491(v=office.14).aspx
    Uploading documents using web services -
    http://cecildt.blogspot.com/2010/10/upload-documents-to-sharepoint-2010.html
    If you have requirements to use Document Sets, keep in mind that this adds a layer of complexity beyond a simple Document Library. Behind the scenes, each Document Set is treated as a separate folder, and although can you query items within it, there might
    be extra steps for getting the sort order to ignore the folder structure. Can you try setting the Scope to be "Recursive" and also specify that you are looking only for files and not folders:
    <Eq><FieldRef Name='FSObjType'/><Value Type='Lookup'>1</Value></Eq></Where>
    Dimitri Ayrapetov (MCSE: SharePoint)

  • 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);

  • How to sort  the arry value in ascending order

    I have a string array where i need to sort the below values in ascending order in the same format...can anyone give me clue on this?
    9.3
    3.1
    9.1
    19.1
    19
    9.4
    9.1.1
    the sorted order should be
    3.1
    9.1
    9.1.1
    9.3
    9.4
    19
    19.1

    You may have easier luck writing your own comparator for this. These are headings in a table of contents, right?
    Write a comparator that tokenizes a string on the '.' character, or use a StringBuffer to remove them, and then order the elements according to the combined numbers. Since alphanumeric would order this list as you want it anyway you could just order that way once the '.' are removed.
    In other words your comparator would do this in the "compare" method:
    public class MyComparator implements Comparator, java.io.Serializable {
    private static Comparator stringComparator = java.text.Collator.getInstance();
    ...constructor(s), your own private "instance" variable of type MyComparator, a getInstance() method of your own, yadda yadda...
    public int compare(Object item1, Object item2) {
    try {
    value1 = removePeriods((String)item1);
    value2 = removePeriods((String)item2);
    if (value1 == null) {
    return (value2 == null) ? 0 : (-1);
    return compare(value1, value2);
    } catch (ClassCastException cce) {
    System.err.println("Wrong Object Type, JackAss!");
    protected int compare(String str1, String str2) {
    return MyComparator.stringComparator.compare(str1, str2);
    private String removePeriods(String value) {
    StringBuffer sb = new StringBuffer(value);
    int decimalIndex = value.indexOf('.');
    while (decimalIndex != -1) {
    sb.delete(decimalIndex, (decimalIndex + 1));
    }

  • In my opinion, the real solution is for Apple to offer us a choice of the photo sort order in ITunes. My preference would be filename, perhaps with options to choose the Date Taken attribute, file timestamp or date modified filestamp (EXIF date fields as

    I tryed to sort my pictures with buying Apps and following suggestion from apple, but without any success. In my opinion, the real solution is for Apple to offer us a choice of the photo sort order in ITunes. My preference would be filename, perhaps with options to choose the Date Taken attribute, file timestamp or date modified filestamp.

    Not a problem when using iPhoto on a Mac, which the transfer of photos is primarily based on - not manually managing photo storage as seems to be common with Windoze.
    The same should be available with a supported photo management app on a PC.
    http://support.apple.com/kb/HT4221

  • Copying attribute values in xsl transformation

    Hi
    Does anyone know how to copy attribute values in a transfomation generated in a routing rule of a ESB routing service.
    When I inspect the generated xsl (after mapping elements), I can see that the xsl:value-of is used and therefore the element attributes of the original message are lost.
    Specifically when an element contains the xsi:nil attribute, I want to copy it to the target message.
    Suggestions would be greatly appreciated,
    Ruud

    Hi Nathalie,
    Thanks for your reply.
    I would like to elaborate a bit on our problem because I feel that we haven't reached a satisfactory solution yet.
    We are using ESB database adapters to perform DML operations on the database. However we expose these adapters using routing services to allow us to use filters, content based routing etc.
    Consider this example:
    I want to perform an update on a row in the database. If my soap call contains an empty element, this element will be ignored. If I want this the corresponding attribute in the database set to NULL then I have to add the xsi:nill="true" attribute to the element in my message. This works great when invoking the database adapter directly but when you place a routing service in front of it, the transformation will wipe out the xsi:nill="true" attribute on the element causing the database adapter to ignore the element instead of updating to NULL.
    We have found two workarounds:
    detectommissions="false" setting in the wsdl of the database adapter. All empty elements in the message will cause an update to NULL in the database. This means that for every update you always have to have all values in your message to prevent unwanted updates to NULL.
    Add a choose / when / otherwise construction in the transformation of the routing service. If the source element is empty we add an empty element in the destination message containing an xsi:nill="true" attribute, otherwise we just copy the value.
    This construction should be added for each attribute that must be updateable to null.
    Both of these solutions are not satisfactory because they eliminate the choice whether an empty element in the invoking soap call should be ignored or used to trigger an update to null.
    We would like to be able to detect the xsi:nill="attribute" on the invoking call and propagate this attribute to the call to the database adapter.
    Kind regards,
    Ruud

  • Update a list item based sort order of created by column value

    HI
    using powershell script how to sort a list column before update a list  item.
    here i created a document library and uploaded some documents and update ProcessNo column based sort order of created column
    value.
    Add-PSSnapin Microsoft.SharePoint.PowerShell -EA SilentlyContinue
    $webURL = "http://tspmcwfe:91" $listName = "Courts"
    Get the SPWeb object and save it to a variable
    $web = Get-SPWeb $webURL
    $list = $web.Lists[$listName] 
    $items = $list.items
    Go through all items
    foreach($item in $items)
    $item["ProcessNo"] = 1
    $item.Update()
    $web.Dispose()

    Hi,
    According to your description, my understanding is that you want to sort the list items order before updating items using PowerShell.
    I suggest you can use the Sort-Object command to sort the list items.
    Here are some detailed articles for your reference:
    Better SharePoint Lists and List Items in PowerShell
    Sort-Object
    Thanks
    Best Regards
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Modify Print/Sort Order of Checks using Template

    I am working on finalizing the template for Check Writer XML and hit a good one.
    Is there a way to change the sort order of how the check would print from within the template?
    If we were able to do this I could do away with the customizations we currently have in place for our Deposit Advice XML.
    The sort order I need is the following: Mailstop (segment1), Last Name and then First Name.
    Is there a way to do this at all?
    Thanks for any guidance.
    G

    1. Try to do it in db itself.
    2. If that is not possible, then specify the sort order in RTF like
    <?for-each:GROUP?>
    <?sort:SEGMENT1;'ascending';data-type='number'?> -- Not sure if its Varchar or Number. Change the data type accordingly
    <?sort:LAST_NAME;'ascending';data-type='text'?>
    <?sort:FIRST_NAME;'ascending';data-type='text'?>
    Do check if the performance is not affected by this.

  • Sort an XMLList on an attribute value?

    How do you sort an XMLList (or XMLListCollection) on an
    attribute value rather than the element content?
    Thanks,
    ...scott

    You use the Sort and SortField objects and assign them to the
    collection:
    var dummyXML:XML = <testdata><test
    field="C"/><test field="A"/><test
    field="X"/><test field="Y"/></testdata>;
    var sorter:Sort = new Sort();
    sorter.fields = [new SortField("@field")];
    var tests:XMLListCollection = new
    XMLListCollection(dummyXML.test);
    tests.sort = sorter;
    tests.refresh();
    trace("First item [" + tests.getItemAt(0).@field + "] Last
    item [" + tests.getItemAt(3).@field + "]");

Maybe you are looking for

  • New replacement (black) BT Vision box

    New black vision box arrived today, installed, but trouble. Most channels are not available and others have distorted sound and picture. ITV1 is OK cannot get BB1 and many others. The Vision box is connected direct to the TV, no other device inbetwee

  • Error: 'mojarra is undefined', How to resolve it.

    Hi, I have an error mojarra is undefined in ADF, How to resolve it. I have a form which have 3 layers. One is Radio button list and then there are two tables, one is master table and another is detailed table. In radio button i defined status after c

  • Applet Notinited.

    Hello every one... I face problem in loading my applet in IE 6.0. The error message "applet <appletname> notinited" displays in the status bar. The applet contains a JList , a JTextAField and a JButton. It works well under AppletViewer. weird?! could

  • BackUp failed because can't activate volume image

    Every time I'm launching an initial backup I'm told that the backup failed, because time capsule could not activate the backup volume image. I connectes my MacProBook 2.4 via an Ethernet cable and selceted the volume from system preferences 'time cap

  • Dashboard Content Linking between Tabs

    Hi all. I'm trying to link several analytics within a corporate dashboard. I've tried linking between Xcelcius SWF and Webi, and between Dashboard Analytics and it works fine. But my problem is that due to design considerations, I've got to link anal