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

Re: testing which files have same element/@code

Subject: Re: testing which files have same element/@code
From: James Cummings <James.Cummings@xxxxxxxxx>
Date: Wed, 30 Jul 2003 09:22:05 +0100 (BST)
barcode 139
>Date: Tue, 19 Aug 2003 10:17:30 -0600
>From: Rick Taylor <taylor@xxxxxxxx>
>Subject: Re:  testing which files have same element/@code
>
>James,
>
>This should work. However, it might be slow if you have lots of files to parse.
>
><xsl:param name="codeValue" select="'124'"/>
>
><xsl:template match="files">
>  <form action="http://www.foo.com">
>   <select name="File-to-see">
>    <xsl:apply-templates
>select="file[count(document(@filename)/foo/bar[@code=$codeValue]) &gt; 0]"/>
>   </select>
>   <input type="hidden" name="code" value="{$codeValue}"/>
>   <input type="submit"/>
>  </form>
></xsl:template>
>
><xsl:template match="file">
>  <option name="{@name}">
>   <xsl:value-of select="@filename"/>
>  </option>
></xsl:template>

Yup, that was the kind of method I was assuming.  I've decided for the
pre-generated files this will be an ok way to do it - it doesn't matter
how long it takes (within reason) to create those.  For those that are
dymanically created in a cocoon pipeline, this seems less reasonable.

I suppose another way to do this would be to create an intermediate
file which contains all the possible @code values with a list of
what files have that code, so I could get the information by opening
only one file, which would be quicker.  So something like:
<foo>
<bar code="123">
<file name="file1.xml"/>
<file name="file2.xml"/>
<file name="file3.xml"/>
<file name="file4.xml"/>
</bar>
<bar code="134">
<file name="file1.xml"/>
<file name="file4.xml"/>
</bar>
<bar code="139"/>
</foo>

-- 
Dr James Cummings, James.Cummings@xxxxxxxxx, http://www.uea.ac.uk/~q503
Cursus Project, School of Music, University of East Anglia,
Norwich, Norfolk, NR4 7TJ, UK  Tel:(01603)593-595



 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.