Skip to Content
avatar image
Former Member

XSLT Mapping in HCI to Sort Compound Employee


I'm using an XSLT mapping to sort the job_information element by last_modified_on. My input structure is input.txt my XSLT mapping is fullsortbydate.txt. It works output.txt the job_information elements are in reverse order, but all the sub-elements of employment_information are missing WHY!!???

This is driving me mad.

Sorry about the text files, but it wouldn't let me upload XML or XSL files.



input.txt (32.1 kB)
output.txt (30.9 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    May 25, 2017 at 07:08 AM

    Hello Jonathan,

    You have tweak your XSLT a little to copy all the EmployementInformation elements.Below code will do the same ( there might be shorter code do the same)

    <xsl:stylesheet version="1.0" xmlns:xsl="">
      <xsl:output method="xml" indent="yes" omit-xml-declaration="yes"/>
      <xsl:template match="@* | node()">
          <xsl:apply-templates select="@* | node()"/>
      <xsl:template match="//CompoundEmployee/person/employment_information">
        <xsl:value-of select="assignment_class"/>
                    <xsl:value-of select="created_by"/>
                    <xsl:value-of select="created_on_timestamp"/>
                    <xsl:value-of select="custom_string1"/>
                    <xsl:value-of select="custom_string2"/>
                    <xsl:value-of select="custom_string3"/>
                    <xsl:value-of select="direct_reports"/>
                    <xsl:value-of select="employment_id"/>
                    <xsl:value-of select="isContingentWorker"/>
                    <xsl:value-of select="jobNumber"/>
                    <xsl:value-of select="last_modified_by"/>
                    <xsl:value-of select="last_modified_on"/>
                    <xsl:value-of select="originalStartDate"/>
                    <xsl:value-of select="start_date"/>
                    <xsl:value-of select="user_id"/>
          <xsl:apply-templates select="job_information">
            <xsl:sort select="last_modified_on"/>
          <xsl:apply-templates select="compensation_information">
            <xsl:sort select="last_modified_on"/>
          <xsl:apply-templates select="associated_employee_information">
            <xsl:sort select="last_modified_on"/>


    Sriprasad Shivaram Bhat

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Sriprasad

      This works absolutely fine.

      Your a clever guy! Thanks a lot for your help.