[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

avoiding Repetition - further refined for clarity

Subject: avoiding Repetition - further refined for clarity
From: "stevenson" <stevenson@xxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 12 Mar 2002 13:25:07 +0300
avoiding repetition test
I have a part of my code of the project am working on below:

What happens is that, if a development requirement is assigned to somebody;
it has its development jobs. But one person can have many development
requirements i.e. <developmentrequirement drid='1'> with it's DJ's i.e.
<developmentjob djdrid="1">, <developmentrequirement drid='2'> with it's
DJ's i.e. < developmentjob djdrid="2">, <developmentrequirement drid='3'>
with it's DJ's i.e. < developmentjob djdrid="3">

What I want to achieve is that once you choose the person with a DR let's
say <developmentrequirement drid='1'>, on the display I get:

<Developmentrequirement drid='1'> with it's <developmentjob djdrid='1''>,
then it gives me the rest of the DJ's

<Developmentjob djdrid='2''>, <developmentjob djdrid='3''> without there
DR's


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



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.