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:email@example.com] > Sent: 19 May 2010 00:16 > To: firstname.lastname@example.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: email@example.com > subscribe: firstname.lastname@example.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!
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