This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: [XSLT] [Q] Recursion Question/Concern
- To: xsl-list at lists dot mulberrytech dot com
- Subject: Re: [xsl] [XSLT] [Q] Recursion Question/Concern
- From: Wendell Piez <wapiez at mulberrytech dot com>
- Date: Wed, 21 Mar 2001 14:21:49 +0000
- Reply-To: xsl-list at lists dot mulberrytech dot com
Jonathan:
What's wrong with:
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="RECORD">
<xsl:number level="any"/>
<xsl:text> </xsl:text>
<xsl:value-of select="INFO1"/>
<xsl:text>&#A;</xsl:text>
</xsl:template>
</xsl:stylesheet>
No counting or recursion required: this is letting XSL's processing model
do all the work.
Was it the xsl:number instruction you forgot about? I'm assuming the
processing model is not mysterious to you at this point. (If it is, let us
know.)
Good luck,
Wendell
At 06:27 PM 3/21/01, you wrote:
>I am new to the list, so please forgive me if I am
>asking something answered elsewhere. I have searched
>the archive and FAQ and have not found the answer I am
>seeking.
>
>I need to count and number "records" in an XML file.
>It would seem that recursion is the answer, but I am
>concerned about performance.
>
>When using recursion I have noticed a 10:1 performance
>decrease over not using recursion. I assume that user
>error is responsible.
>
>If I do not use a recursive function then my template
>will process in roughly 1 second. I do not get the
>desired results because I need individual numbered
>lines. When I use the recursive function then
>performance goes to roughly 10 seconds.
>
>Any and all help would be appreciated. Thanks in
>advance for your time.
>
>
>Example of XML file format:
>
><DATA>
> <RECORD>
> <INFO1>xyz</INFO1>
> </RECORD>
> <RECORD>
> <INFO1>abc</INFO1>
> </RECORD>
>...
></DATA>
>
>The desired result would be:
>1 xyz
>2 abc
>...
======================================================================
Wendell Piez mailto:wapiez@mulberrytech.com
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
======================================================================
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list