Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
| Search | Today's Posts | Mark Forums Read
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT 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 October 3rd, 2007, 09:36 AM
Registered User
 
Join Date: Oct 2007
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Creating a list but not displaying certain values

Hi

I have a bit of a problem when using a unique list, basically what I'm doing is creating a list of Covers, however business requirements dictate that we don't show a particular plan when for instance the Movement effect is a cancellation (ie POLCAN) , so for example I have the following xml sample
------------------------------------------
<PACK_PURPOSE>
<MovementType>POLCAN</MovementType>
<ObjectType>123456</ObjectType>
<LevelOfCoverDisplay>Plan TEST Option</LevelOfCoverDisplay>
</PACK_PURPOSE>
<PACK_PURPOSE>
<MovementType>POLNWB</MovementType>
<ObjectType>1234567</ObjectType>
<LevelOfCoverDisplay>Plan TEST2</LevelOfCoverDisplay>
</PACK_PURPOSE>
---------------------------------------------
So block of text to display would be something like

"Thank you for continuing to choosing <PlanTEST2> from test. Everything you need for your new policy has been enclosed.

How can I create a unique list of values for LevelOfCoverDisplay while at the same time dictating not to display a LevelOfCoverDisplay when Movement is Cancellation.

Would it be better to modify the xml directly

Any advice would be appreciated.
Thanks



Josephine
 
Old October 3rd, 2007, 10:00 AM
joefawcett's Avatar
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Well assuming your PACK_PURPOSE elements are enclosed in a PACK_PURPOSES element, otherwise your XML is not well-formed, then I'd apply-templates to
Code:
/PACK_PURPOSES/PACK_PURPOSE[not(MovementType = 'POLCAN')]
You can then have a template match PACK_PURPOSE and output the LevelOfCoverDisplay and whatever else you need.


--

Joe (Microsoft MVP - XML)
 
Old October 4th, 2007, 10:37 AM
Registered User
 
Join Date: Oct 2007
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Joe

This is exactly what I need thanks

Josephine




Similar Threads
Thread Thread Starter Forum Replies Last Post
multi-column list box values moved to 2nd list box sbmvr Access VBA 1 May 14th, 2007 01:58 PM
filtering files while displaying in list box anandthecoolest C# 1 March 8th, 2007 02:04 PM
filtering files while displaying in list box anandthecoolest C# 2005 0 March 8th, 2007 03:21 AM
Displaying values in dropdown list from mysql db scoobie Beginning PHP 3 January 25th, 2005 12:09 PM
Displaying listbox values.....??? Brettvan1 VB.NET 2002/2003 Basics 4 December 13th, 2004 06:42 PM





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