This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
avoiding repetition - more refined
- From: "stevenson" <stevenson at epr dot footman-walker dot com>
- To: <XSL-List at lists dot mulberrytech dot com>
- Date: Tue, 12 Mar 2002 10:18:27 +0300
- Subject: [xsl] avoiding repetition - more refined
- Reply-to: xsl-list at lists dot mulberrytech dot com
I have a part of my code of the project am working on below:
<calls xmlns:sql="urn:schemas-microsoft-com:xml-sql">
<DevelopmentRequirement drid="1">
<YearPart>01</YearPart>
<Title>Registration</Title>
<Site>0</Site>
<with>steve</with>
<Updated>2001-10-19T09:47:23.903</Updated>
<DevelopmentJob djid="1" djdrid="1">
<YearPart>01</YearPart>
<Title>FWClinicalView lookups work</Title>
<DateTime>2001-01-16T19:58:26</DateTime>
<LastActionBy>10</LastActionBy>
</DevelopmentJob>
<DevelopmentJob djid="2" djdrid="1">
<YearPart>01</YearPart>
<Title>FWClinicalView lookups work</Title>
<DateTime>2001-01-16T19:58:26</DateTime>
<LastActionBy>10</LastActionBy>
</DevelopmentJob>
<DevelopmentJob djid="3" djdrid="1">
<YearPart>01</YearPart>
<Title>FWClinicalView lookups work</Title>
<DateTime>2001-01-16T19:58:26</DateTime>
<LastActionBy>10</LastActionBy>
</DevelopmentJob>
</DevelopmentRequirement>
<DevelopmentRequirement drid="2">
<YearPart>01</YearPart>
<Title>Registration</Title>
<Site>0</Site>
<with>steve</with>
<Updated>2001-10-19T09:47:23.903</Updated>
<DevelopmentJob djid="2" djdrid="2">
<YearPart>01</YearPart>
<Title>FWClinicalView lookups work</Title>
<DateTime>2001-01-16T19:58:26</DateTime>
<LastActionBy>10</LastActionBy>
</DevelopmentJob>
<DevelopmentJob djid="3" djdrid="2">
<YearPart>01</YearPart>
<Title>FWClinicalView lookups work</Title>
<DateTime>2001-01-16T19:58:26</DateTime>
<LastActionBy>10</LastActionBy>
</DevelopmentJob>
</DevelopmentRequirement>
</calls>
What i want to achieve is to display a <DevelopmentRequirement drid="1">
with it's <DevelopmentJob djdrid="1"> assigned to <with>steve</with> and
when it finishes displaying the <DevelopmentJob djdrid="1">, then it shows
the rest of the development jobs i.e <DevelopmentJob djdrid="2">.....
assigned to the same person, without repeting <DevelopmentJob djdrid="1">.
That is, i display:
<calls xmlns:sql="urn:schemas-microsoft-com:xml-sql">
<DevelopmentRequirement drid="1">
<YearPart>01</YearPart>
<Title>Registration</Title>
<Site>0</Site>
<with>steve</with>
<Updated>2001-10-19T09:47:23.903</Updated>
<DevelopmentJob djid="1" djdrid="1">
<YearPart>01</YearPart>
<Title>FWClinicalView lookups work</Title>
<DateTime>2001-01-16T19:58:26</DateTime>
<LastActionBy>10</LastActionBy>
</DevelopmentJob>
<DevelopmentJob djid="2" djdrid="1">
<YearPart>01</YearPart>
<Title>FWClinicalView lookups work</Title>
<DateTime>2001-01-16T19:58:26</DateTime>
<LastActionBy>10</LastActionBy>
</DevelopmentJob>
<DevelopmentJob djid="3" djdrid="1">
<YearPart>01</YearPart>
<Title>FWClinicalView lookups work</Title>
<DateTime>2001-01-16T19:58:26</DateTime>
<LastActionBy>10</LastActionBy>
</DevelopmentJob>
</DevelopmentRequirement>
+++++++++++++++(PLUS)
<DevelopmentJob djid="2" djdrid="2">
<YearPart>01</YearPart>
<Title>FWClinicalView lookups work</Title>
<DateTime>2001-01-16T19:58:26</DateTime>
<LastActionBy>10</LastActionBy>
</DevelopmentJob>
<DevelopmentJob djid="3" djdrid="2">
<YearPart>01</YearPart>
<Title>FWClinicalView lookups work</Title>
<DateTime>2001-01-16T19:58:26</DateTime>
<LastActionBy>10</LastActionBy>
</DevelopmentJob>
I am displaying them using the below xsl template:
<xsl:choose>
<xsl:when test="$SortOrder= '1'">
<xsl:apply-templates select="calls/DevelopmentJob">
<xsl:sort select="Priority"/>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="calls/DevelopmentJob">
<xsl:sort select="Order"/>
</xsl:apply-templates>
</xsl:otherwise>
</xsl:choose>
<xsl:choose>
<xsl:when test="$SortOrder= '1' and $ShowDJs= '1'">
<xsl:apply-templates
select="calls/DevelopmentRequirement/DevelopmentJob">
<xsl:sort select="Priority"/>
</xsl:apply-templates>
</xsl:when>
<xsl:when test="$SortOrder= '0' and $ShowDJs= '1'">
<xsl:apply-templates
select="calls/DevelopmentRequirement/DevelopmentJob">
<xsl:sort select="Order"/>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
</xsl:otherwise>
</xsl:choose>
I hope i am clear. how can i achieve this?
Stevenson Ngila,
Footman-Walker Associates
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list