 |
 |
 |
Hi Manfred,
Thanks for your reply.
I will try your approach and let you know if it
improves the speed of the transformation.
One thing I will have to figure out is a way to
measure the speed improvement. I do not want to only
look at the watch and count the seconds.
I might use Javascript with the time function and
alert how long each approach takes (start time - end
time). Do you have any suggestions on how I could
measure that in an easier way?
Also, I did not quite understand your the simpler
approach suggestion. Could you please elaborate a bit
more on that?
> Another (simpler) approach would be to limit the
> maximum number of
> dimensions for the table so you can use match
> patterns like
> match="ColGrp"
> match="ColGrp/ColGrp"
> match="ColGrp/ColGrp/ColGrp"
> match="ColGrp/ColGrp/ColGrp/ColGrp"
> match="ColGrp[Col]"
> match="Col"
Cheers
C
--- Manfred Staudinger <manfred.staudinger@xxxxxxxxx>
wrote:
> On 01/03/2008, Cleyton Jordan
> <cleytonjordan@xxxxxxxxxxx> wrote:
> > However, I thought that by using // followed by a
> > predicate (
> //ColGrp[count(ancestor::ColGrp)=$depth]
> > ), I would go straight to only those inner most
> ColGrp
> > elements parent of the Col elements.
> No, the XPath processor first has to find a ColGrp
> element by looking
> into every corner of the input doc, and then check
> for the condition.
>
> > There is one problem with your approach though.
> You
> > are assuming that there will always be only two
> ColGrp
> > like this:
> >
> > <xsl:for-each
> >
>
select="/Reports/Report/Columns/ColGrp/ColGrp[count(ancestor::ColGrp)=$depth]">
>
> I would propose a slightly different approach:
> <xsl:for-each
> select="/Reports/Report/Columns/ColGrp">
> <xsl:apply templates mode="ColGrp"/>
> </xsl:for-each>
> passing the parameters needed for your processing
> and using only two
> templates for ColGrp: one for the innermost ColGrp,
> and one for the
> others
> <xsl:templates match="ColGrp[Col]" mode="ColGrp">
> processing for the innermost ColGrp here
> </xsl:for-each>
> <xsl:templates match="ColGrp" mode="ColGrp">
> processing here (you can always test the depth with
> count(ancestor::ColGrp))
> </xsl:for-each>
> plus one for Col:
> <xsl:templates match="Col" mode="ColGrp">
> processing here
> </xsl:for-each>
>
> Another (simpler) approach would be to limit the
> maximum number of
> dimensions for the table so you can use match
> patterns like
> match="ColGrp"
> match="ColGrp/ColGrp"
> match="ColGrp/ColGrp/ColGrp"
> match="ColGrp/ColGrp/ColGrp/ColGrp"
> match="ColGrp[Col]"
> match="Col"
>
> Hope this helps,
>
> Manfred
>
>
__________________________________________________________
Sent from Yahoo! Mail.
A Smarter Inbox. http://uk.docs.yahoo.com/nowyoucan.html
|
 | 

|  |
These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.
|  |
| |
 |
 |
 |