XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
RE: [xml-dev] XML documents get richer and richer the more XSLT rules that process it


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-dev] 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]


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS