Subject: RE: [xsl] How to do an 'existence' test in XSL? From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> Date: Wed, 22 Dec 2004 15:50:26 -0500 |
In this case the OP was grasping for a solution to a *simple* requirement, in his words. It's poor form if XSL can only offer a complex solution when there is a simple need.
When all the possible values are known ahead of time (as is most likely the case here), then a complex grouping algorithm would certainly not be acceptable if something simpler would also do the job.
I don't know which solution would provide the best performance in this instance, but unless this is a particularly performance critical section of the application, then simplicity should win over performance considerations every time.
input: <gui type="alertBox">...</gui> <gui type="tooltip">...</gui> <gui type="help">...</gui> <gui type="tooltip">...</gui> <gui type="alertBox">...</gui> <gui type="tooltip">...</gui> <gui type="help">...</gui>
<xsl:variable name="gui-type-list"> <gui type="alertBox"/> <gui type="tooltip"/> <gui type="alertbox"/> </xsl:variable>
<xsl:variable name="gui-types" select="document('')/*/xsl:variable[@name='gui-type-list']/gui"/>
<xsl:for-each select="$gui-types"> <xsl:if test="@type = $all-guis/@type"> <gui type="{@type}"/> </xsl:if> </xsl:for-each>
Cheers, Wendell
====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] How to do an 'existence' , George James | Thread | Re: Re: [xsl] How to do an 'existen, ben |
[xsl] Again -- non MS transform Sar, Graber, Jeffrey | Date | Re: [xsl] How to do an 'existence' , Dimtre Novatchev |
Month |