|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: testing which files have same element/@code
>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]) > 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








