[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: DOM and XPath slows down the
Hi, Products I am using? not many. Am using XPath with DOM, using a GUI using java swing on a windows platform. The performance doesnot slowdown linearly. Its rather exponential. Any ideas? /Khurram --- XSL-List Digest <owner-xsl-list-digest@xxxxxxxxxxxxxxxxxxxxxx> wrote: > XSL-List Digest Tuesday, December 18 2001 > Volume 03 : Number 1340 > > > > In this issue: > > RE: Tree Fragment - How do I test it AND > output it? > RE: DOM and XPath slows down the > application > Re: How do I compare all similar type > nodes? > Re: ampersand character in xsl attribute? > RE: Tree Fragment - How do I test it AND > output it? > RE: General Searching query > RE: ampersand character in xsl attribute? > RE: How do I compare all similar type > nodes? > Re: How do I compare all similar type > nodes? > > ---------------------------------------------------------------------- > > Date: Tue, 18 Dec 2001 08:27:23 -0000 > From: "Chris Bayes" <chris@xxxxxxxxxxx> > Subject: RE: Tree Fragment - How do I test it > AND output it? > > David, > Not sure what you mean (it's early). You can't do > both. Well you can but > you can't recurse returning a value to the calling > template and output > nodes to the result tree at the same time. Here are > a few examples that > show a few things you can do. > > <?xml version="1.0" ?> > <values a="3" b="5"> > </values> > > > <?xml version="1.0"?> > <xsl:stylesheet version="1.0" > xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > xmlns:msxsl="urn:schemas-microsoft-com:xslt" > extension-element-prefixes="msxsl" > > > <xsl:template match="/values"> > <xsl:variable name="resultFromTemplateValue"> > <xsl:call-template > name="namedTemplateValue"/> > </xsl:variable> > <xsl:variable name="resultFromTemplateRtf"> > <xsl:call-template > name="namedTemplateRtf"/> > </xsl:variable> > <svg> ... here is some stuff > I actually want to output, because I'm > drawing svg. > <g><xsl:value-of > select="$resultFromTemplateValue"/></g> > <g><xsl:value-of > select="$resultFromTemplateRtf"/></g> > <g><xsl:call-template > name="namedTemplateValue"/></g> > <g><xsl:call-template > name="namedTemplateRtf"/></g> > <g>A Result <xsl:value-of > select="msxsl:node-set($resultFromTemplateRtf)/a * > msxsl:node-set($resultFromTemplateRtf)/b"/></g> > </svg> > </xsl:template> > > <xsl:template name="namedTemplateValue"> > <xsl:variable name="resultFromTemplate"> > <!--you would call the template again here--> > <xsl:value-of select="@a * @b" /> > </xsl:variable> > <xsl:if test="$resultFromTemplate != > 0"><g>[Result != > 0]</g></xsl:if> > <xsl:value-of select="$resultFromTemplate"/> > </xsl:template> > > <xsl:template name="namedTemplateRtf"> > <xsl:variable name="resultFromTemplate"> > <!--you would call the template again > here--> > <a><xsl:value-of select="@a" /></a> > <b><xsl:value-of select="@b" /></b> > </xsl:variable> > <xsl:if > test="msxsl:node-set($resultFromTemplate)/a * > msxsl:node-set($resultFromTemplate)/b != > 0"><g>[Result != > 0]</g></xsl:if> > <xsl:copy-of > select="$resultFromTemplate"/> > </xsl:template> > </xsl:stylesheet> > > Produces > > <?xml version="1.0" encoding="UTF-16" ?> > <svg> > ... here is some stuff I actually want to output, > because I'm drawing > svg. > <g>[Result != 0]15</g> > <g>[Result != 0]35</g> > <g> > <g>[Result != 0]</g> > 15 > </g> > <g> > <g>[Result != 0]</g> > <a>3</a> > <b>5</b> > </g> > <g>A Result 15</g> > </svg> > > Ciao Chris > > XML/XSL Portal > http://www.bayes.co.uk/xml > > > > -----Original Message----- > > From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx > > [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On > Behalf Of > > David Penton > > Sent: 18 December 2001 05:08 > > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx > > Subject: Tree Fragment - How do I test it > AND output it? > > > > > > How do I both test the "return" value from a > template, and > > output some of the result nodes? I have written a > recursive > > template that is intended to "draw" some xml as > svg. The > > template must do some calculations about the depth > of the > > input xml, and about its "width" (i.e. how many > children a > > particular node has. My problem is that I do not > know how to > > both get a "return" value from a template that I > can test > > (i.e. treating the named template like a kind of > function), > > and also get output from it: > > > > Roughly, I want to do this: > > > > <xsl:template name="namedTemplate"> > > <svg> ... here is some stuff > > I actually want to output, because I'm > drawing svg. > > </svg> > > > > <!-- > > but I need to compute a value via a > recursive call > > to this same template: > > --> > > > > <xsl:variable name="resultFromTemplate"> > > <xsl:call-template > name="namedTemplate"> > > </xsl:variable> > > > > <!-- and use the "returned" value: --> > > > > <xsl:if test="$resultFromTemplate != 0"> > ...</xsl:if> > > > > <!-- > > Here I'll "return" a value computed in > this > > named template, to control processing in > the calling > > template (i.e. the earlier instance of > this same one): > > --> > > > > <xsl:value-of > select="$somethingCalculatedHere"/> > > > > </xsl:template> > > > > > > Is there a way to do this? I suppose, to get at > the results, > === message truncated === __________________________________________________ Do You Yahoo!? Check out Yahoo! Shopping and Yahoo! Auctions for all of your unique holiday gifts! Buy at http://shopping.yahoo.com or bid at http://auctions.yahoo.com 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
|