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

Re: XML Schema: "Best used with the ______ tool"

  • From: "Andrew Welch" <andrew.j.welch@g...>
  • To: "Boris Kolpackov" <boris@c...>
  • Date: Wed, 3 Dec 2008 11:01:40 +0000

Re:  XML Schema: "Best used with the ______ tool"
Running the following transform against that file using Kernow's
performance testing facility:

<xsl:stylesheet version="2.0"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	xmlns:xs="http://www.w3.org/2001/XMLSchema"
	xmlns:t="http://www.example.com/test"
	exclude-result-prefixes="xs t">

<xsl:param name="age" select="25" as="xs:integer"/>
<xsl:param name="gender" select="'female'" as="xs:string"/>

<xsl:template match="/">
	<xsl:for-each select="/t:people/person[@gender eq
$gender][xs:integer(@age) lt $age]">
		<xsl:value-of select="concat(string-join((@first, @last, @age), ',
'), '&#xa;')"/>
	</xsl:for-each>	
</xsl:template>


</xsl:stylesheet>


Gives this result:

Ran 5 times
Run 1: 445 ms
Run 2: 178 ms
Run 3: 216 ms
Run 4: 335 ms
Run 5: 163 ms
Ignoring first 2 times
Total Time (last 3 runs): 714 ms
Average Time (last 3 runs): 238 ms


That time includes writing the result to the output window.



2008/12/3 Andrew Welch <andrew.j.welch@g...>:
> Hi Boris,
>
>> Note how in the XQuery case I had to invent a delimiter (':') for
>> the first, last, and age fields so that I could pass them as a string
>> from XQuery to the programming language. I then had to manually parse
>> this string and convert the age field to unsigned short. To me, this
>> doesn't look easier than data binding at all.
>
> Surely you wouldn't return a delimited string, you would return person
> nodes and then select the values from the returned nodes?
>
> Also, the comparison isn't quite right - the only fair thing would be
> time how long it takes to output the information to a file or standard
> out (the gui language would likely be different in either case, say
> swing vs html)
>
>


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


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
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

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.