Wrox Programmer Forums
|
BOOK: XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition ISBN: 978-0-470-19274-0
This is the forum to discuss the Wrox book XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition by Michael Kay; ISBN: 9780470192740
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition ISBN: 978-0-470-19274-0 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 17th, 2010, 09:30 AM
Registered User
 
Join Date: Dec 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Unhappy Problems with generate-id

Hi all this is my first post here im trying to populate a dropdown list with a list of teams without duplicates

The site im working in can be found here: http://www.voa.gov.uk/rli/static/Hel...ortclass=SHOPS

as you can see im sorting one xml by diffrent premises shops , offices etc then genarating a table of the relavent data. but i also need to allow the user to sort by contact team.

One Node in the xml is:
<sub_programme>
<valuation_class>SHOPS</valuation_class>
<sub_programme_id>M171-CS-1010</sub_programme_id>
<valuation_classes>Shops</valuation_classes>
<valuation_scheme_references>
<ref href="http://www.2010.voa.gov.uk/rli/en/advanced/searchResults/_params/listYear/2010/searchFor/PROPERTY/searchBy/SCHEME/searchType/scheme/step/simpleSearch/scheme/114609">114609</ref>
<ref href="http://www.2010.voa.gov.uk/rli/en/advanced/searchResults/_params/listYear/2010/searchFor/PROPERTY/searchBy/SCHEME/searchType/scheme/step/simpleSearch/scheme/107748">107748</ref>
<ref href="http://www.2010.voa.gov.uk/rli/en/advanced/searchResults/_params/listYear/2010/searchFor/PROPERTY/searchBy/SCHEME/searchType/scheme/step/simpleSearch/scheme/105410">105410</ref>
<ref href="http://www.2010.voa.gov.uk/rli/en/advanced/searchResults/_params/listYear/2010/searchFor/PROPERTY/searchBy/SCHEME/searchType/scheme/step/simpleSearch/scheme/105995">105995</ref>
</valuation_scheme_references>
<ba_codes>1730, 1705</ba_codes>
<ba_names>Hart District Council, Basingstoke &amp; Deane BC</ba_names>
<list_year>2010</list_year>
<sub_programme_title>RETAIL IN BASINGSTOKE &amp; HART</sub_programme_title>
<start_date Mdate="20110124">24-Jan-2011</start_date>
<target_date Mdate="20110325">25-Mar-2011</target_date>
<contact_team href="http://www.voa.gov.uk/rli/static/HelpPages/Valuation/English/DraftProgramme/teamcontact.asp?teamid=Wessex_Basingstoke&amp;sub_ programme_id=M171-CS-1010">Basingstoke</contact_team>
<status title="DRAFT">DF</status>
<publication_date>05-Nov-2010 at 13:00</publication_date>
<universal_valuation_lookup>[114609][107748][105410][105995]</universal_valuation_lookup>
</sub_programme>
<sub_programme>
<valuation_class>SHOPS</valuation_class>
<sub_programme_id>M176-REST-1010</sub_programme_id>
<valuation_classes>Shops</valuation_classes>
<valuation_scheme_references>
<ref href="http://www.2010.voa.gov.uk/rli/en/advanced/searchResults/_params/listYear/2010/searchFor/PROPERTY/searchBy/SCHEME/searchType/scheme/step/simpleSearch/scheme/102232">102232</ref>
<ref href="http://www.2010.voa.gov.uk/rli/en/advanced/searchResults/_params/listYear/2010/searchFor/PROPERTY/searchBy/SCHEME/searchType/scheme/step/simpleSearch/scheme/102231">102231</ref>
</valuation_scheme_references>
<ba_codes>1780, 1740</ba_codes>
<ba_names>Southampton City Council, New Forest District Council</ba_names>
<list_year>2010</list_year>
<sub_programme_title>RESTAURANTS SOUTHAMPTON &amp; NEW FOREST PRE 31-10-10</sub_programme_title>
<start_date Mdate="20110124">24-Jan-2011</start_date>
<target_date Mdate="20110325">25-Mar-2011</target_date>
<contact_team href="http://www.voa.gov.uk/rli/static/HelpPages/Valuation/English/DraftProgramme/teamcontact.asp?teamid=Wessex_Southampton&amp;sub_ programme_id=M176-REST-1010">Southampton</contact_team>
<status title="DRAFT">DF</status>
<publication_date>05-Nov-2010 at 13:00</publication_date>
<universal_valuation_lookup>[102232][102231]</universal_valuation_lookup>
</sub_programme>

and in the xslt I have :
IN THE HEAD
<xsl:param name="param1"></xsl:param>
<xsl:param name="param2"></xsl:param>
<xsl:key name="uniqueContact" match="draft_programme/sub_programme" use="contact_team"/>

THEN
<!--populate the dropdownlist-->
<xsl:template name="ddl_contact_team">
<form action="workingDraft.asp" method="get" style="float:right;margin-bottom:-2em;margin-top:20px;text-align:right;width:459px;">
<input type="hidden" value="{$param1}" name="sortclass" />
<label for="sortcontact">Sort by contact location: </label>
<select name="sortcontact" id="sortcontact">
<option value="" selected='selected'>-Select-</option>
<xsl:for-each select="draft_programme/sub_programme[valuation_class=$param1 and generate-id() = generate-id(key('uniqueContact', contact_team))]">
<xsl:sort select="contact_team" data-type="text" order="ascending"/>
<option value="{contact_team}"><xsl:value-of select="contact_team"/></option>
</xsl:for-each>
</select>
<input name="go" type="submit" value="go" /><a href="workingDraft.asp?sortclass={$param1}" style=" text-align:right; margin:0 0 0 1em">Clear contact location filter</a>
</form>
<xsl:element name="p">
This list was last updated on: <strong><xsl:value-of select="draft_programme/last_updated_date"/></strong>
</xsl:element>

</xsl:template>


the problem is that as you move throught the diffrent types of buildings ths dropdown list is not provid all the teams.

Any Help with this problem would be greatly apprecated





Similar Threads
Thread Thread Starter Forum Replies Last Post
generate-id() cross-reference kaiLa XSLT 5 June 7th, 2010 12:55 PM
generate unique id capri SQL Server 2000 1 April 6th, 2008 10:18 AM
generate id grouping using xslt meetnaveen4u XSLT 0 May 23rd, 2005 05:14 AM
Generate-id problem. meetnaveen4u XSLT 2 May 13th, 2005 12:06 AM
Generate unique ID when populating a table sroman SQL Server 2000 2 August 5th, 2003 03:38 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.