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

RE: XML documents get richer and richer the more XSLT rules th

  • From: "Michael Kay" <mike@saxonica.com>
  • To: "'Costello, Roger L.'" <costello@mitre.org>,<xml-dev@l...>
  • Date: Wed, 19 May 2010 10:08:10 +0100

RE:  XML documents get richer and richer the more XSLT rules th

I explored this kind of idea in my Extreme Markup 2007 paper, "Writing an
XSLT Optimizer in XSLT":

http://www.saxonica.com/papers/Extreme2007/EML2007Kay01.html

The main practical difficulty was that in this kind of environment, each
rule application typically rewrites a small part of the source tree, and all
the cost is incurred in copying the parts of the tree that don't change. The
approach only becomes feasible in performance terms if one can optimize
transformations where the output is a small change to the input, typically
by using some kind of delta storage in which the unchanged parts of the tree
are not repeatedly copied.

But there may be other ways of tackling the problem that I haven't thought
of.

Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay 
 

> -----Original Message-----
> From: Costello, Roger L. [mailto:costello@mitre.org] 
> Sent: 19 May 2010 00:16
> To: xml-dev@lists.xml.org
> Subject:  XML documents get richer and richer the 
> more XSLT rules that process it
> 
> Olivier Rossel wrote:
> 
> > rules can add data to the working memory, and these data 
> will trigger 
> > other rules that add other data to the working memory, and so on.
> 
> Fascinating!
> 
> I decided to create an example to illustrate this. Would 
> someone be willing to create an XSLT implementation?
> 
> This is the input document to an XSLT program:
> 
> <Gun>
>      <serial>ABCD</serial>
> </Gun>
> 
> The XSLT program contains a rule for the Gun serial element. 
> The rule fires. The rule maps serial numbers to person names. 
> Thus, the rule adds person information to the XML document. 
> After the rule finishes, this is the XML document:
> 
> <GunLicense>
>     <registeredGun>
>          <Gun>
>               <serial>ABCD</serial>
>          </Gun>
>     </registeredGun>
>     <holder>
>          <Person>
>               <name>Fred Blogs</name>
>          </Person>
>     </holder>
> </GunLicense>
> 
> The XSLT program contains a rule for the Person name element. 
> The rule fires. The rule maps names to drivers license 
> numbers. The rule adds drivers license information to the XML 
> document. After the rule finishes, this is the XML document: 
> 
> <GunLicense>
>     <registeredGun>
>          <Gun>
>               <serial>ABCD</serial>
>          </Gun>
>     </registeredGun>
>     <holder>
>          <Person>
>               <name>Fred Blogs</name>
>               <driversLicenseNumber>ZXYZXY</driversLicenseNumber>
>          </Person>
>     </holder>
> </GunLicense>
> 
> The XSLT program contains a rule for the driversLicenseNumber 
> element. The rule has information about a speeder that the 
> police just pulled over, and a recent robbery where the 
> robber dropped the gun. The driver's license and Gun serial 
> number match the values in the XML document. The rule knows 
> that only one gun can have any given serial number, and only 
> one person can have any given driver's license number, so the 
> rule outputs this as the result XML document:
> 
> <Alert>
>    The speeder is the person who committed the recent robbery!
> </Alert>
> 
> Recap: the initial XML input into the XSLT program is small. 
> A rule for the Gun serial element fires and adds Person data 
> to the XML input document. This causes a rule for the Person 
> name element to fire, which adds driver's license data to the 
> XML input document. This causes a rule for driver's license 
> element to fire, which recognizes that the speeder is the 
> robber; the rule outputs an XML document that alerts the 
> police about the person he has pulled over.
> 
> The XSLT rules add data to the XML input document! The XML 
> document gets richer and richer the more rules that process it!
> 
> Would someone be willing to write an XSLT program that 
> implements this? 
> 
> Thanks Olivier!
> 
> /Roger
> 
> 
> ______________________________________________________________
> _________
> 
> XML-DEV is a publicly archived, unmoderated list hosted by 
> OASIS to support XML implementation and development. To 
> minimize spam in the archives, you must subscribe before posting.
> 
> [Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/
> Or unsubscribe: xml-dev-unsubscribe@lists.xml.org
> subscribe: xml-dev-subscribe@lists.xml.org List archive: 
> http://lists.xml.org/archives/xml-dev/
> List Guidelines: http://www.oasis-open.org/maillists/guidelines.php
> 



[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.