Sorting thro' xslt

hai,
i am bala.
I had generated one html table which contains the fields fetched from the mysql database.
For generating the html i had used one of the techniques in xslt that using Stream source..
I had sorted the table on loading time...
But i have to do sorting when a particular column heading is clicked,based on that particular column
the overall table should be sorted....
Is there any technique available for that...
Please help me in that.....
I want it immediately.....
Here is my xsl coding:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- Edited with XML Spy v4.2 -->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<HTML>
<head>
<script>
     function sortDomainPass()
          alert("hi")
</script>
</head>
<BODY>
<title>XSLT</title>
<table border="2" align="center">
<tr align="center">
<th><B>DomainName</B></a></th>
<th><B>DominPassword</B></a></th>
<th><B>DominEmailID</B></th>
<th><B>DominURL</B></th>
<th><B>DominAddress</B></th>
<th><B>DominState</B></th>
<th><B>DominCountry</B></th>
<th><B>DominZipCode</B></th>
<th><B>DominFax</B></th>
<th><B>DominPhone</B></th>
</tr>
<xsl:for-each select="domainReport/domain">
<xsl:sort select="domainName" order="ascending"/>
<tr align="center">
<td><font><xsl:value-of select="domainName"/></font></td>
<td><font><xsl:value-of select="domainPass"/></font></td>
<td><font><xsl:value-of select="domainEmailID"/></font></td>
<td><font><xsl:value-of select="domainURL"/></font></td>
<td><font><xsl:value-of select="domainAddress"/></font></td>
<td><font><xsl:value-of select="domainState"/></font></td>
<td><font><xsl:value-of select="domainCountry"/></font></td>
<td><font><xsl:value-of select="domainZipCode"/></font></td>
<td><font><xsl:value-of select="domainFax"/></font></td>
<td><font><xsl:value-of select="domainPhone"/></font></td>
</tr>
</xsl:for-each>
</table>
</BODY>
</HTML>
</xsl:template>
</xsl:stylesheet>
Thanks for your help
bala

http://www.mulberrytech.com/xsl/xsl-list/
Go there to ask questions about XSLT (but read the FAQ there first). If you have questions about Java & XML then ask them here.

Similar Messages

  • I got error msg while i called the Java Funtion in XI thro XSLT

    Hi,
    In XI, i need one method/function for getting the current date/time without any parameter, because its only shows the current date/time from getting the system. So,I have been created a simple method/function in java without any parameter for getting the current date/time from the system. Using the XSLT to call the mehtod/function and assigned in the particular field. After i mapped that XSLT  file in the XI, i executed in XI and also i gave input for some other fields and finally i got the Transmission error message.
    <b>Error Message:
    javax.xml.transform.TransformerException: com.sap.engine.lib.xml.util.NestedException: Illegal number of arguments or types of arguments in a call of function 'dateEST:ConvertToEST'.</b>
    Here ConvertToEST is the method/function name, method/function was return in String datatype, and also in XI that field have same String datatype. This field have only return the current date/time.There is no input for this.
    I have been excuted this method/function in Java, its working fine. So, give me your suggestion for this.
    p.s. Award points if your answer is useful for me.
    Thanks & Regards
    Prakash T

    Hi Prakash,
    Can you tell me how u resolved the issue? Even I am facing the same error while running XSLT mapping in XI.
    Regards,
    Karen Pereira

  • XSLT Grouping & Sorting in 10g BPEL

    Hi,
    Can any one tell how we can achieve grouping and sorting of xslt in soa 10g.
    This is possible in 11g but not getting any clue as how to proceed for 10g.
    Please response soon.
    Thanks & Regards,
    Divya

    this one works for me
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:ns1="http://xmlns.oracle.com/SampleJDE_BioprodProcess">
         <xsl:template match="/">
              <ns1:SampleJDE_BioprodProcessProcessResponse>
                   <xsl:for-each select="/ns1:SampleJDE_BioprodProcessProcessResponse/ns1:billToNumber">
                        <xsl:sort select="."/>
                        <test>
                             <xsl:value-of select="."/>
                        </test>
                   </xsl:for-each>
              </ns1:SampleJDE_BioprodProcessProcessResponse>
         </xsl:template>
    </xsl:stylesheet>output
    <?xml version="1.0" encoding="UTF-8"?>
    <ns1:SampleJDE_BioprodProcessProcessResponse xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:ns1="http://xmlns.oracle.com/SampleJDE_BioprodProcess">
         <test>1</test>
         <test>2</test>
         <test>9</test>
    </ns1:SampleJDE_BioprodProcessProcessResponse>

  • XSLT Enhancement with Java, Tokenize Functionality

    I tried the following requirement using EXSLT with no luck. Is there any other alternative to tokenize in XSLT 1.0.
    The syntax i have here is  
    <xsl:for-each select="tokenize($this/Field1,',')">
           <xsl:variable name="f1v" select="."/>
         <xsl:for-each select="tokenize($this/Field2,'\|')">
              <xsl:variable name="f2v" select="."/>
              <xsl:for-each select="tokenize($this/Field3,'\|')">
                        <xsl:variable name="f3v" select="."/>
    There are multiple for-each based on tokens
    I am leaning towards to Enhancing XSLT with Java Function. As i have less experience with Java, can anybody help me with the code that can be used by XSLT for Tokenize functionality.
    I have written something like following. I still have errors to fix. But i am not sure about having resultSet or return at the end, to make sure all the tokens were sent to XSLT.
    public class MyStringToken
         public static void main(String [] args)
              String str = "sssd;wwer;ssswwwwdwwwwwwwwwww;wwwwe";
              String delimiter = ";";
              MyStringToken my = new MyStringToken();
              my.getTokens(str,delimiter);
         public void getTokens(String str,String delimiter)
              StringTokenizer st = new StringTokenizer(str,delimiter);
              while(st.hasMoreElements())
                   try
                        String delString = new String(st.nextElement().toString());
                        return (delString);
                   catch(Exception e)
                        e.printStackTrace();
    Any help is appreciated

    Hi,
    I have been searching about, and I have found the next example that maybe can help you, It's a template to tokenize in XSLT 1.0 from the web [http://stackoverflow.com/questions/1018974/tokenizing-and-sorting-with-xslt-1-0]
    <xsl:template name="tokenize">
      <xsl:param name="string" />
      <xsl:param name="delimiter" select="' '" />
      <xsl:choose>
        <xsl:when test="$delimiter and contains($string, $delimiter)">
          <token>
            <xsl:value-of select="substring-before($string, $delimiter)" />
          </token>
          <xsl:text> </xsl:text>
          <xsl:call-template name="tokenize">
            <xsl:with-param name="string"
                            select="substring-after($string, $delimiter)" />
            <xsl:with-param name="delimiter" select="$delimiter" />
          </xsl:call-template>
        </xsl:when>
        <xsl:otherwise>
          <token><xsl:value-of select="$string" /></token>
          <xsl:text> </xsl:text>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:template>
    Also I have found the next example of use tokenize in EXSLT from [http://exslt.org/str/functions/tokenize/index.html] It can be that inI your tests you are not using "str:tokenize", no?
    <xsl:template match="a">
       <xsl:apply-templates />
    </xsl:template>
    <xsl:template match="*">
       <xsl:value-of select="." />
          <xsl:value-of select="str:tokenize(string(.), ' ')" />
       <xsl:value-of select="str:tokenize(string(.), '')" />
       <xsl:for-each select="str:tokenize(string(.), ' ')">
          <xsl:value-of select="." />
       </xsl:for-each>
       <xsl:apply-templates select="*" />
    </xsl:template>
    I hope that helps you.
    Best.
    Jorge

  • Custom Sort via the XSL and custom template?

    I am trying to add a sort order to a CQWP. I would like a template style that does the sorting? I have to sort by a field called SortOrder, then I want it to be by file name - here is the code:
    I am thinking to do a foreach but not able to get it working? Is there another easier way?
    <!--Start Custom Policy Sort-->
        <xsl:template name="PolicySortedBullets" match="Row[@Style='PolicySortedBullets']" 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="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 link-item bullet">
                <xsl:call-template name="OuterTemplate.CallPresenceStatusIconTemplate"/>
       <a href="{$SafeLinkUrl}" title="{@LinkToolTip}" target="_blank">
                  <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>
                  <xsl:value-of select="$DisplayTitle"/>
                </a>
            </div>
        </xsl:template>
    <!--End Custom Policy Sort-->

    http://stackoverflow.com/questions/5415383/xslt-sortingboth-ascending-and-descending
    http://sharepoint.stackexchange.com/questions/81167/content-query-web-part-group-by-sort
    You can use the XSLT <xsl:sort> element to customize your sort order.
    https://sites.google.com/site/icsharepoint2010/xslt/sorting-in-xslt
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:output method="text"/>
    <xsl:template match="employees">
    <xsl:apply-templates>
    <xsl:sort select="salary"/>
    </xsl:apply-templates>
    </xsl:template>
    <xsl:template match="employee">
    Last: <xsl:apply-templates select="last"/>
    First: <xsl:apply-templates select="first"/>
    Salary: <xsl:apply-templates select="salary"/>
    Hire Date: <xsl:apply-templates select="@hireDate"/>
    <xsl:text>
    </xsl:text>
    </xsl:template>
    </xsl:stylesheet>

  • Web Service Object Parameters and JAXB

    Hi All,
    This is my first post here and I'm hoping one of you might have encountered a similar problem before. One of our business partners provided us with a WSDL for their service, with an embedded XML schema. My job in this case is to write a message driven bean (MDB) that will take a message containing XML off of a queue and call this web service. However, their web service requires an object to be passed as input. So, I've used JAXB to generate a set of classes (from the schema I ripped out of their WSDL) that will unmarshal the XML document that comes off the queue. This works fine, however, the resulting object is an inherently different object than the object I need to pass to the web service, that one was created by auto-generating the Java proxy for the web service. Since these two classes come from the same schema definition, they have the same structure and can hold the same data, but they have different implementations. My plan is to write a method to copy the data from one object to another, but this feels redundant. Is there any approach I could use to make these two auto-generated sets of code be more compatible, other than the obvious answer of having written everything by hand? Thanks in advance for any replies.

    Are the XML instances coming from the queue and the request object to the WS defined by the same schema (from the business partner)? If they are different, there's no other option than to do a copy or some sort of XSLT (not that that's any easier though). But if the instances are defined by the same schema, just use some data binding framework that you can use for both reading the XML from the queue and that is incorporated into the WS toolkit you're using.
    For example, Axis2 allows you to use XMLBeans as a the data binding framework. Using the generated classes from Axis2, you can read in the XML instances from the queue and at the same time have the request object for the WS call.

  • XSLT mapping sorting against an output field

    Hi, all
    I am testing my XSLT mapping. Here is the output message type defintion:
    I want to sort f2 in my xslt mapping. Here is my mapping:
    <?xml version="1.0" encoding="UTF-8" ?>
      <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns0="http://fileconversion" xmlns:ns1="http://fileconversion">
        <xsl:template match="/">
          <ns1:TESTOUTPUT_MT>
            <Msg>
            <xsl:for-each select="ns0:TESTDATA_MT/Trans/Detail">
            <xsl:sort select="Transaction/Data/f2" />
              <Transaction>
                <Data>
                  <f1>
                    <xsl:value-of select="PERNR" />
                  </f1>
                  <f2>
                    <xsl:value-of select="POSITION" />
                  </f2>
                  <f3>
                    <xsl:value-of select="TEL" />
                  </f3>
                  <f4>
                    <xsl:value-of select="concat(concat(STREET,' '),CITY)" />
                  </f4>
                </Data>
              </Transaction>
                </xsl:for-each>
            </Msg>
          </ns1:TESTOUTPUT_MT>
        </xsl:template>
      </xsl:stylesheet>
    The sorting did not execute on field "f2" and the data is in the same order as the input.
    Note that I can do <xsl:sort select="POSITION " /> instead and it will work. But I am trying to test on sorting against output field as this is the requirement in the real interface.
    What did I do wrong? Please advise.
    Thanks,
    Jonathan.

    Hi Jon - You can sort the source values. If you use "sort select="Transaction/Data/f2" i don't think it has got some effect.
    You can use <xsl:sort select="POSITION " /> Any issues with that?
    Just to add - when you map Position with F2... how does the sorting will be different when you execute it on F2 or Position?
    If you are doing some calculation for F2 then should handle the Sort function accordingly..

  • Sorting on specific  field using XSLT Mapping

    Hi All,
    I am trying to sort the records on specific field using XSLT mapping.But I'm unable get the proper output for the following code.
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:a="http://xxxxxxxx">
    <xsl:output method="xml" indent="yes" />
         <xsl:template match="/">
              <a:T1>
                   <Row>
                             <xsl:for-each select="a:S1/Record">
                             <xsl:sort select="EmpID" />
                             <EMPID>
                                  <xsl:value-of select="EmpID"/>
                             </EMPID>
                             <ENAME>
                                  <xsl:value-of select="EmpName"/>
                             </ENAME>
                        </xsl:for-each>
                        </Row>
              </a:T1>
         </xsl:template>
    </xsl:stylesheet>>
    Currently getting following output :
    http://www.flickr.com/photos/21390012@N04/2074799747/
    Expected output should be like below :
    http://www.flickr.com/photos/21390012@N04/2074807393/
    Kindly send me suggestion to achieve this.
    Regards
    Pullarao

    Hi ,
    I donno much about srting in XSLT but i can give you one example on that.
    Example :
    This is how to sort numbers in xslt.
    Try this :
    <xsl:for-each select="learn[@kind='done']">
         <xsl:sort select="number(@rank)" data-type="number"/>
         <table border="00" cellpadding="3" width="100%">
                   <tr>
                        <td width="100" valign="top" align="right"><input type="checkbox" checked="checked" readonly="readonly"/></td>
                        <td width="10" valign="top" align="right"><xsl:value-of select="position()"/>. </td>
                        <td valign="top">
                             [<xsl:value-of select="@rank"/>] <xsl:value-of select="@title"/>
                        </td>
                   </tr>
         </table>
         <table border="00" cellpadding="3" width="100%">
                   <tr>
                        <td width="100"> </td>
                        <td valign="top">
                             <xsl:apply-templates/>
                        </td>
                   </tr>
         </table>
    </xsl:for-each>
    Regards
    Aashish Sinha
    PS : reward points if helpful

  • Query on sorting  XML using XSLT and getting the same XML as output !

    Hi,
    Looking for one information regarding sorting XML using XSLT , with the sorted XML as output. For eg. my XML is :
    <?xml version="1.0"?>
    <?xml-stylesheet type="text/xsl" href="sort1.xsl"?>
    <levelone>
         <child ID="1" sort="5">
              <name>Paul</name>
         </child>
         <child ID="2" sort="1">
              <name>Adam</name>
         </child>
         <child ID="3" sort="2">
              <name>Will</name>
         </child>
    </levelone>
    and XSL :
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:template match="/levelone">
         <xsl:copy>
         <xsl:apply-templates>
              <xsl:sort select="@sort"/>
         </xsl:apply-templates>
              </xsl:copy>
         </xsl:template>
         <xsl:template match="child">
              <xsl:copy-of select="."/>
         </xsl:template>
    </xsl:stylesheet>
    This does the sort based on Name. But I want to get the same xml as output with the name sorted. Eg.
    <?xml version="1.0"?>
    <?xml-stylesheet type="text/xsl" href="sort1.xsl"?>
    <levelone>
         <child ID="2" sort="1">
              <name>Adam</name>
         </child>
         <child ID="1" sort="5">
              <name>Paul</name>
         </child>
         <child ID="3" sort="2">
              <name>Will</name>
         </child>
    </levelone>
    Any pointers will be highly appreciated.
    - Thanks

    Don't you want <xsl:sort select="name"/> rather than <xsl:sort select="@sort"/>?

  • Dynamic XSLT Sort Routine to XML (NCName:* or QName was expected)

    I am trying to create a XSLT Stylesheet to perform dynamic sorts (via parameters) on XML data with the desired output being XML... I've declared everything static in my StyleSheet for debugging purposes:
    XML Document:
    <?xml version="1.0" encoding="UTF-8"?>
    <Content>
    <task:TASK id="25"
    src:col="/db/iconnect/MappingCenterCRM/default/TASK"
    src:key="25" xmlns:src="http://xml.apache.org/xindice/Query" xmlns:task="http://iconnect.com/schemas/task">
    <task:user_id>123</task:user_id>
    <task:long_description>This is my description...</task:long_description>
    <task:priority>1</task:priority>
    <task:status>Completed</task:status>
    </task:TASK>
    <task:TASK id="26"
    src:col="/db/iconnect/MappingCenterCRM/default/TASK"
    src:key="26" xmlns:src="http://xml.apache.org/xindice/Query" xmlns:task="http://iconnect.com/schemas/task">
    <task:user_id>123</task:user_id>
    <task:long_description>Another description...</task:long_description>
    <task:priority>1</task:priority>
    <task:status>New</task:status>
    </task:TASK>
    </Content>
    Here is my Stylesheet:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:task="http://iconnect.com/schemas/task" xmlns:src="http://xml.apache.org/xindice/Query">
    <xsl:output method="xml" />
    <xsl:param name="sortBy" select="task:long_description" />
    <xsl:param name="xPath" select="//Content/task:TASK" />
    <xsl:param name="orderByType" select="ascending" />
    <xsl:template match="$xPath | node()">
    <xsl:copy>
    <xsl:apply-templates>
    <xsl:sort select="$sortBy" order="ascending"/>
    </xsl:apply-templates>
    </xsl:copy>
    </xsl:template>
    </xsl:stylesheet>
    When I run in XMLSpy, I get the desired results, but when running using Xerces, I get the following error:
    javax.xml.transform.TransformerException: A node test that matches either NCName:* or QName was expected.

    I am trying to create a XSLT Stylesheet to perform dynamic sorts (via parameters) on XML data with the desired output being XML... I've declared everything static in my StyleSheet for debugging purposes:
    XML Document:
    <?xml version="1.0" encoding="UTF-8"?>
    <Content>
    <task:TASK id="25"
    src:col="/db/iconnect/MappingCenterCRM/default/TASK"
    src:key="25" xmlns:src="http://xml.apache.org/xindice/Query" xmlns:task="http://iconnect.com/schemas/task">
    <task:user_id>123</task:user_id>
    <task:long_description>This is my description...</task:long_description>
    <task:priority>1</task:priority>
    <task:status>Completed</task:status>
    </task:TASK>
    <task:TASK id="26"
    src:col="/db/iconnect/MappingCenterCRM/default/TASK"
    src:key="26" xmlns:src="http://xml.apache.org/xindice/Query" xmlns:task="http://iconnect.com/schemas/task">
    <task:user_id>123</task:user_id>
    <task:long_description>Another description...</task:long_description>
    <task:priority>1</task:priority>
    <task:status>New</task:status>
    </task:TASK>
    </Content>
    Here is my Stylesheet:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:task="http://iconnect.com/schemas/task" xmlns:src="http://xml.apache.org/xindice/Query">
    <xsl:output method="xml" />
    <xsl:param name="sortBy" select="task:long_description" />
    <xsl:param name="xPath" select="//Content/task:TASK" />
    <xsl:param name="orderByType" select="ascending" />
    <xsl:template match="$xPath | node()">
    <xsl:copy>
    <xsl:apply-templates>
    <xsl:sort select="$sortBy" order="ascending"/>
    </xsl:apply-templates>
    </xsl:copy>
    </xsl:template>
    </xsl:stylesheet>
    When I run in XMLSpy, I get the desired results, but when running using Xerces, I get the following error:
    javax.xml.transform.TransformerException: A node test that matches either NCName:* or QName was expected.

  • Extend XSLT sort function

    Is there a way to extend the sort function provided by XSLT? I am using XALAN. Basically, the elements that I need to sort need a more specific sort than just text or number.
    thanks

    well the default sorts are on number or text. But say I want to sort on network addresses, such as 1.2.3.4 ....text and number dont work here, I need my own sorting (like i would do with a Comparator)..
    so if i had
    1.2.3.4
    170.1.3.3
    2.4.3.2
    I would want the sort to be like
    1.2.3.4
    2.4.3.2
    170.1.3.3
    ...however (number wont work) and text sort does
    1.2.3.4
    170.1.3.3
    2.4.3.2
    see what i mean?

  • Remove tokens from string and sort string via  XSLT mapping

    Hi,
    I have a requirement wherein I need to sort the records in an XML file with customer num & order number.
    The value of order number is concatenation of order and item like: 3249_110 , 3249_10, 3290_110,3290_10 and so on.
    Expected result:
    3249_10
    3249_110
    3290_10
    3290_110
    The sort on order number is not giving correct result as its not considering it as an number and the output I am getting is:
    3249_110
    3249_10
    3290_110
    3290_10
    code used:
    <xsl:for-each select="DELIVERYHEADER">
                   <xsl:sort select="./EXTCUSTOMERNO"/>
                   <xsl:sort data-type="number" order="ascending" select="/EXTORDERNO"/>
                   <xsl:copy-of select=".">
                   </xsl:copy-of>
    Please suggest.
    Thanks!
    Indu Khurana

    Source:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <ORIONSHIPMENTS>
         <TRIP>
              <ACTION>I</ACTION>
              <SHIFTNO>1</SHIFTNO>
              <SEQUENCENO>1</SEQUENCENO>
              <DATE>2010-12-20 00:00:00</DATE>
              <STARTDATE>2010-12-20 06:00:00</STARTDATE>
              <ENDDATE>2010-12-20 14:54:00</ENDDATE>
              <TRIPNO>10</TRIPNO>
              <TRIPMNEMONIC/>
              <DRIVERID>DRIVERORT2</DRIVERID>
              <DRIVERNO>DRIVERORT2</DRIVERNO>
              <EXTDRIVERNO>12345</EXTDRIVERNO>
              <TRUCKID>Truck 01</TRUCKID>
              <TRUCKNO>Truck 01</TRUCKNO>
              <EXTTRUCKNO>5002053</EXTTRUCKNO>
              <TRAILERID>Trailer 2</TRAILERID>
              <TRAILERNO>Trailer 2</TRAILERNO>
              <EXTTRAILERNO>ORTEC00002</EXTTRAILERNO>
              <DELIVERYCT>2</DELIVERYCT>
              <LOADCT>1</LOADCT>
              <STARTDEPOTNO>GHENT_N</STARTDEPOTNO>
              <EXTSTARTDEPOTNO>4020</EXTSTARTDEPOTNO>
              <ENDDEPOTNO>GHENT_N</ENDDEPOTNO>
              <EXTENDDEPOTNO>4020</EXTENDDEPOTNO>
              <STARTLOCATIONNO>GHENT_N</STARTLOCATIONNO>
              <EXTSTARTLOCATIONNO>4020</EXTSTARTLOCATIONNO>
              <ENDLOCATIONNO>GHENT_N</ENDLOCATIONNO>
              <EXTENDLOCATIONNO/>
              <ANCILLARYTIME>0</ANCILLARYTIME>
              <LOADINGTIME>0</LOADINGTIME>
              <DISCHARGETIME>245</DISCHARGETIME>
              <DRIVETIME>289</DRIVETIME>
              <DISTANCE>0</DISTANCE>
              <LOADINGSTARTED>0</LOADINGSTARTED>
              <COMMENT/>
              <LOAD>
                   <ACTION>I</ACTION>
                   <LOADID />
                   <LOADIDADD />
                   <SEQUENCENO>0</SEQUENCENO>
                   <LOADINGDEPOTNO>GHENT_N</LOADINGDEPOTNO>
                   <EXTLOADINGDEPOTNO>4020</EXTLOADINGDEPOTNO>
                   <LOADINGPOINT />
                   <AUTHORISATIONCODE />
                   <COMPARTMENTTO>
                        <COMPARTMENTNO>1</COMPARTMENTNO>
                        <PRODUCTNO>401611</PRODUCTNO>
                        <EXTPRODUCTNO>000000000000401611</EXTPRODUCTNO>
                        <VOLUME>65</VOLUME>
                        <UOM>LT</UOM>
                   </COMPARTMENTTO>
              </LOAD>
              <DELIVERYHEADER>
                   <ACTION>I</ACTION>
                   <SEQUENCENO>1</SEQUENCENO>
                   <ORDERNO>3949_20</ORDERNO>
                   <EXTORDERNO>3949_201</EXTORDERNO>
                   <CUSTORDERNO>01.01 Crea</CUSTORDERNO>
                   <CUSTOMERNO>0050000001</CUSTOMERNO>
                   <EXTCUSTOMERNO>0050000001</EXTCUSTOMERNO>
                   <DELIVERYNAME>TEST ORTEC</DELIVERYNAME>
                   <DELIVERYADDRESS1>Rue de Belgique</DELIVERYADDRESS1>
                   <DELIVERYADDRESS2/>
                   <DELIVERYADDRESS3/>
                   <DELIVERYPOSTCODE/>
                   <DELIVERYTOWN/>
                   <DELIVERYCOUNTRY>BE</DELIVERYCOUNTRY>
                   <INVOICENAME/>
                   <INVOICEADDRESS1/>
                   <INVOICEADDRESS2/>
                   <INVOICEADDRESS3/>
                   <INVOICEPOSTCODE/>
                   <INVOICETOWN/>
                   <INVOICECOUNTRY/>
                   <PHONENUMBER1/>
                   <PHONENUMBER2>0</PHONENUMBER2>
                   <TAXCODE />
                   <CUSTOMERCOMMENTS>0013</CUSTOMERCOMMENTS>
                   <DELIVERYCOMMENTS/>
                   <DOCUMENTTYPE>2</DOCUMENTTYPE>
                   <DELIVERYWINDOWSTARTDATE>2010-12-20 00:00:00</DELIVERYWINDOWSTARTDATE>
                   <DELIVERYWINDOWENDDATE>2010-12-20 23:59:00</DELIVERYWINDOWENDDATE>
                   <DELIVERYLINECT>1</DELIVERYLINECT>
                   <DELIVERYAUTHORISATIONREQUIRED/>
                   <CUSTOMERLANGUAGE/>
                   <CONTACTNAME/>
                   <COMPANYREFERENCE/>
                   <CUSTOMERTAXNO/>
                   <FISCALDELIVERY>0</FISCALDELIVERY>
                   <PAYMENTMETHOD>0</PAYMENTMETHOD>
                   <PAYMENTDAYSDUE>999</PAYMENTDAYSDUE>
                   <CURRENCY/>
                   <CALLBEFOREDELIVERY>0</CALLBEFOREDELIVERY>
                   <GEOFENCEDISTANCE>0</GEOFENCEDISTANCE>
                   <GEOFENCEPHONE/>
                   <SITEACCESSGRADE/>
                   <NORMALTAXRATE/>
                   <SPECIALTAXRATE>0</SPECIALTAXRATE>
                   <DISCOUNT>0</DISCOUNT>
                   <SIGNATURECAPTURED/>
                   <DISTANCELOADINGDEPOT>184</DISTANCELOADINGDEPOT>
                   <DRIVETIMELOADINGDEPOT>145</DRIVETIMELOADINGDEPOT>
                   <DISTANCENEXTSTOP>0</DISTANCENEXTSTOP>
                   <DRIVETIMENEXTSTOP>0</DRIVETIMENEXTSTOP>
                   <LOADRELEVANT/>
                   <DELIVERYLINE>
                        <ACTION>I</ACTION>
                        <MOVEMENTNO>3949_20001</MOVEMENTNO>
                        <EXTMOVEMENTNO>3949_20</EXTMOVEMENTNO>
                        <PRODUCTNO>401611</PRODUCTNO>
                        <EXTPRODUCTNO>000000000000401611</EXTPRODUCTNO>
                        <PLANNEDQTY>20</PLANNEDQTY>
                        <UOM>LT</UOM>
                        <PRICEPERUNIT/>
                        <DISCOUNT/>
                        <COMMENTS/>
                        <COMPARTMENTFROM>
                             <COMPARTMENTNO>1</COMPARTMENTNO>
                             <VOLUME>0</VOLUME>
                             <TANKNO>1</TANKNO>
                             <EXTTANKNO>1</EXTTANKNO>
                             <TANKID>259454</TANKID>
                             <TANKLABEL/>
                             <PRODUCTNO>401611</PRODUCTNO>
                             <EXTPRODUCTNO>000000000000401611</EXTPRODUCTNO>
                             <UOM>LT</UOM>
                        </COMPARTMENTFROM>
                   </DELIVERYLINE>
              </DELIVERYHEADER>
              <DELIVERYHEADER>
                   <ACTION>I</ACTION>
                   <SEQUENCENO>2</SEQUENCENO>
                   <ORDERNO>3949_110</ORDERNO>
                   <EXTORDERNO>3949_110</EXTORDERNO>
                   <CUSTORDERNO>01.01 Crea</CUSTORDERNO>
                   <CUSTOMERNO>0050000001</CUSTOMERNO>
                   <EXTCUSTOMERNO>0050000001</EXTCUSTOMERNO>
                   <DELIVERYNAME>TEST ORTEC</DELIVERYNAME>
                   <DELIVERYADDRESS1>Rue de Belgique</DELIVERYADDRESS1>
                   <DELIVERYADDRESS2/>
                   <DELIVERYADDRESS3/>
                   <DELIVERYPOSTCODE/>
                   <DELIVERYTOWN/>
                   <DELIVERYCOUNTRY>BE</DELIVERYCOUNTRY>
                   <INVOICENAME/>
                   <INVOICEADDRESS1/>
                   <INVOICEADDRESS2/>
                   <INVOICEADDRESS3/>
                   <INVOICEPOSTCODE/>
                   <INVOICETOWN/>
                   <INVOICECOUNTRY/>
                   <PHONENUMBER1/>
                   <PHONENUMBER2>0</PHONENUMBER2>
                   <TAXCODE />
                   <CUSTOMERCOMMENTS>0013</CUSTOMERCOMMENTS>
                   <DELIVERYCOMMENTS/>
                   <DOCUMENTTYPE>2</DOCUMENTTYPE>
                   <DELIVERYWINDOWSTARTDATE>2010-12-20 00:00:00</DELIVERYWINDOWSTARTDATE>
                   <DELIVERYWINDOWENDDATE>2010-12-20 23:59:00</DELIVERYWINDOWENDDATE>
                   <DELIVERYLINECT>1</DELIVERYLINECT>
                   <DELIVERYAUTHORISATIONREQUIRED/>
                   <CUSTOMERLANGUAGE/>
                   <CONTACTNAME/>
                   <COMPANYREFERENCE/>
                   <CUSTOMERTAXNO/>
                   <FISCALDELIVERY>0</FISCALDELIVERY>
                   <PAYMENTMETHOD>0</PAYMENTMETHOD>
                   <PAYMENTDAYSDUE>999</PAYMENTDAYSDUE>
                   <CURRENCY/>
                   <CALLBEFOREDELIVERY>0</CALLBEFOREDELIVERY>
                   <GEOFENCEDISTANCE>0</GEOFENCEDISTANCE>
                   <GEOFENCEPHONE/>
                   <SITEACCESSGRADE/>
                   <NORMALTAXRATE/>
                   <SPECIALTAXRATE>0</SPECIALTAXRATE>
                   <DISCOUNT>0</DISCOUNT>
                   <SIGNATURECAPTURED/>
                   <DISTANCELOADINGDEPOT>184</DISTANCELOADINGDEPOT>
                   <DRIVETIMELOADINGDEPOT>145</DRIVETIMELOADINGDEPOT>
                   <DISTANCENEXTSTOP>173</DISTANCENEXTSTOP>
                   <DRIVETIMENEXTSTOP>144</DRIVETIMENEXTSTOP>
                   <LOADRELEVANT/>
                   <DELIVERYLINE>
                        <ACTION>I</ACTION>
                        <MOVEMENTNO>3949_110001</MOVEMENTNO>
                        <EXTMOVEMENTNO>3949_110</EXTMOVEMENTNO>
                        <PRODUCTNO>401611</PRODUCTNO>
                        <EXTPRODUCTNO>000000000000401611</EXTPRODUCTNO>
                        <PLANNEDQTY>45</PLANNEDQTY>
                        <UOM>LT</UOM>
                        <PRICEPERUNIT/>
                        <DISCOUNT/>
                        <COMMENTS/>
                        <COMPARTMENTFROM>
                             <COMPARTMENTNO>1</COMPARTMENTNO>
                             <VOLUME>0</VOLUME>
                             <TANKNO>1</TANKNO>
                             <EXTTANKNO>1</EXTTANKNO>
                             <TANKID>259454</TANKID>
                             <TANKLABEL/>
                             <PRODUCTNO>401611</PRODUCTNO>
                             <EXTPRODUCTNO>000000000000401611</EXTPRODUCTNO>
                             <UOM>LT</UOM>
                        </COMPARTMENTFROM>
                   </DELIVERYLINE>
              </DELIVERYHEADER>
         </TRIP>
    </ORIONSHIPMENTS>

  • XSLT Sort Issues

    I have an XML document that give me a list of PO lines and orders. When I get the PIX message I want to sort it by PO number and then PO Line. For some reason my syntax below isn't working. I need to sort by Reference2 then Reference4. I tried to just get 4 to work but that wasn't working either.
    <xsl:template match="/">
    <xsl:for-each select="tXML/Message/PIX">
    <xsl:sort select="PIXFields/Reference4"/>
         <xsl:apply-templates select="."/>     
    </xsl:for-each>
    </xsl:template>
    </xsl:stylesheet>
    <tXML>
         <Message>
              <PIX>
                   <TransactionType>603</TransactionType>
                   <TransactionCode>02</TransactionCode>
                   <TransactionNumber>10731</TransactionNumber>
                   <SequenceNumber>1</SequenceNumber>
                   <PIXFields>
                        <DateCreated>11/29/12 13:25 EST</DateCreated>
                        <ReferenceCode1>104</ReferenceCode1>
                        <Reference1>ASN1769527</Reference1>
                        <ReferenceCode2>108</ReferenceCode2>
                        <Reference2>1769527</Reference2>
                        <ReferenceCode3>107</ReferenceCode3>
                        <ReferenceCode4>43</ReferenceCode4>
                        <Reference4>7.000</Reference4>
                   </PIXFields>
              </PIX>
              <PIX>
                   <TransactionType>603</TransactionType>
                   <TransactionCode>02</TransactionCode>
                   <TransactionNumber>10731</TransactionNumber>
                   <SequenceNumber>2</SequenceNumber>
                   <PIXFields>
                        <DateCreated>11/29/12 13:25 EST</DateCreated>
                        <ReferenceCode1>104</ReferenceCode1>
                        <Reference1>ASN1769527</Reference1>
                        <ReferenceCode2>108</ReferenceCode2>
                        <Reference2>1769527</Reference2>
                        <ReferenceCode3>107</ReferenceCode3>
                        <ReferenceCode4>43</ReferenceCode4>
                        <Reference4>7.000</Reference4>
                   </PIXFields>
              </PIX>
              <PIX>
                   <TransactionType>603</TransactionType>
                   <TransactionCode>02</TransactionCode>
                   <TransactionNumber>10731</TransactionNumber>
                   <SequenceNumber>3</SequenceNumber>
                   <PIXFields>
                        <DateCreated>11/29/12 13:25 EST</DateCreated>
                        <ReferenceCode1>104</ReferenceCode1>
                        <Reference1>ASN1769527</Reference1>
                        <ReferenceCode2>108</ReferenceCode2>
                        <Reference2>1769527</Reference2>
                        <ReferenceCode3>107</ReferenceCode3>
                        <ReferenceCode4>43</ReferenceCode4>
                        <Reference4>3.000</Reference4>
                   </PIXFields>
              </PIX>
              <PIX>
                   <TransactionType>603</TransactionType>
                   <TransactionCode>02</TransactionCode>
                   <TransactionNumber>10731</TransactionNumber>
                   <SequenceNumber>4</SequenceNumber>
                   <PIXFields>
                        <DateCreated>11/29/12 13:25 EST</DateCreated>
                        <ReferenceCode1>104</ReferenceCode1>
                        <Reference1>ASN1769527</Reference1>
                        <ReferenceCode2>108</ReferenceCode2>
                        <Reference2>1769527</Reference2>
                        <ReferenceCode3>107</ReferenceCode3>
                        <ReferenceCode4>43</ReferenceCode4>
                        <Reference4>6.000</Reference4>
                   </PIXFields>
              </PIX>
              <PIX>
                   <TransactionType>603</TransactionType>
                   <TransactionCode>02</TransactionCode>
                   <TransactionNumber>10731</TransactionNumber>
                   <SequenceNumber>5</SequenceNumber>
                   <PIXFields>
                        <DateCreated>11/29/12 13:25 EST</DateCreated>
                        <ReferenceCode1>104</ReferenceCode1>
                        <Reference1>ASN1769527</Reference1>
                        <ReferenceCode2>108</ReferenceCode2>
                        <Reference2>1769527</Reference2>
                        <ReferenceCode3>107</ReferenceCode3>
                        <ReferenceCode4>43</ReferenceCode4>
                        <Reference4>10.000</Reference4>
                   </PIXFields>
              </PIX>
              <PIX>
                   <TransactionType>603</TransactionType>
                   <TransactionCode>02</TransactionCode>
                   <TransactionNumber>10731</TransactionNumber>
                   <SequenceNumber>6</SequenceNumber>
                   <PIXFields>
                        <DateCreated>11/29/12 13:25 EST</DateCreated>
                        <ReferenceCode1>104</ReferenceCode1>
                        <Reference1>ASN1769527</Reference1>
                        <ReferenceCode2>108</ReferenceCode2>
                        <Reference2>1769527</Reference2>
                        <ReferenceCode3>107</ReferenceCode3>
                        <ReferenceCode4>43</ReferenceCode4>
                        <Reference4>2.000</Reference4>
                   </PIXFields>
              </PIX>
         </Message>
    </tXML>

    This is usually achieved with a classic identity transformation, amended with a special template to process element(s) of interest :
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
      <xsl:template match="node()">
        <xsl:copy>
          <xsl:apply-templates select="node()"/>
        </xsl:copy>
      </xsl:template>
      <xsl:template match="Message">
        <xsl:copy>
          <xsl:apply-templates select="PIX">
            <xsl:sort select="PIXFields/Reference2" data-type="number"/>
            <xsl:sort select="PIXFields/Reference4" data-type="number"/>
          </xsl:apply-templates>
        </xsl:copy>
      </xsl:template>
    </xsl:stylesheet>

  • XSLT and sorting

    I use a style sheet to sort nodes in an XML document. It works fine, but there are cases where a parent node does not contain the child node as there is no value (i.e. column is null). Is there a way to skip parent nodes for child nodes that don't exist?

    That worked great. Thanks a LOT!
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Steven Muench ([email protected]):
    Rather than thinking about skipping nodes you don't want, think instead about selecting the nodes you do want.
    So, instead of selecting:
    select="ROWSET/ROW"
    You can select instead:
    select="ROWSET/ROW[SAL]"
    which will select only the <ROW> elements that have a <SAL> child element.<HR></BLOCKQUOTE>
    null

  • How to sort the data in JSP using stylesheet sorting?

    Hi, i extracted data out in and display them <%=data%> in the jsp, but how to sort? do i have to provide a drop down list that gives different sorting options, and when user clicks on one option, say sort by title, the collection of results are sorted out on the same jsp page? so all in all, only one jsp page is needed or do i need to create xml files, etc?
    i have no idea how to integrate the xml sorting into the jsp page, even after seeing online help, cos there is no example of a jsp page with sorting to refer to. PLease help, thanks alot!

    im getting the data from beans, but one of the requirements was that i cant use the database to sort and display but i have to use xslt to do the sorting in the jsps, so i have no idea how to do so. possible to give an example? thanks

Maybe you are looking for

  • Sdo_filter fail when query against a spatial view in different schema

    We have a table with X,Y coordinates and would like to run spatial query against it. We do not want to change the table structure, so we opt to use a function based index. USER_SDO_GEOM_METADATA is updated and index is built. Then we created a view w

  • Set the margin automatically in a landscape report

    How can I set the margin automatically in a landscape report without manual setting in page setup before printing the report in oracle report6?

  • Interactive Page Curl - But printing?

    My client is insistent on having an interactive PDF (with mousover zooms, hyperlinks and so on) including a page turn. This is fine, I have read and done the tutorials on iPDFs (exporting as SWF, importing to Acrobat etc). However, the client wants h

  • JSP  Call  C  Library  through  JNI  ?

    Hi experts : I has a jsp file which create a bean to call native c method. It still works fine after 10 to 14 times' page refresh, then it throws exception when call a native method. If I restart the Tomcat it works again ,but shuch situtation repeat

  • Customer since 2011

    Once upon a time I was very happy with comcast. I moved April 2015 to a new residence. I called comcast to transfer my services. Per phone conversation I was told we could upgrade to hd TV at no charge my monthly bill would stay the same and I would